Add PlanetScale provider migration #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| docker: | |
| name: Build Docker Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Docker metadata | |
| id: metadata | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value=latest | |
| type=ref,event=tag | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and Push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| file: Dockerfile.multi | |
| push: true | |
| tags: ${{ steps.metadata.outputs.tags }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64,linux/arm64 | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Linux x86_64 | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: ow-linux-x86_64 | |
| use_cross: false | |
| # Linux aarch64 (ARM64) | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: ow-linux-aarch64 | |
| use_cross: true | |
| # macOS Intel | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| name: ow-macos-x86_64 | |
| use_cross: false | |
| # macOS Apple Silicon | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| name: ow-macos-aarch64 | |
| use_cross: false | |
| # Windows | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| name: ow-windows-x86_64.exe | |
| use_cross: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| if: matrix.use_cross == true | |
| run: | | |
| cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build (cross) | |
| if: matrix.use_cross == true | |
| run: cross build --release --target ${{ matrix.target }} | |
| - name: Build (cargo) | |
| if: matrix.use_cross == false | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Prepare binary (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cp target/${{ matrix.target }}/release/ow ow | |
| chmod +x ow | |
| tar czf ${{ matrix.name }}.tar.gz ow | |
| - name: Prepare binary (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| copy target\${{ matrix.target }}\release\ow.exe ow.exe | |
| 7z a ${{ matrix.name }}.zip ow.exe | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: | | |
| ${{ matrix.name }}.tar.gz | |
| ${{ matrix.name }}.zip | |
| if-no-files-found: ignore | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Display structure | |
| run: ls -R artifacts | |
| - name: Create checksums | |
| run: | | |
| cd artifacts | |
| for dir in */; do | |
| cd "$dir" | |
| for file in *; do | |
| if [ -f "$file" ]; then | |
| sha256sum "$file" >> ../checksums.txt | |
| fi | |
| done | |
| cd .. | |
| done | |
| cat checksums.txt | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| files: | | |
| artifacts/*/*.tar.gz | |
| artifacts/*/*.zip | |
| artifacts/checksums.txt | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-crates: | |
| name: Publish to crates.io | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Publish to crates.io | |
| run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |