chore: automate Railway image deploy #1
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-plz | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| # Release unpublished packages. | |
| release-plz-release: | |
| if: ${{ github.repository_owner == 'nearai' }} | |
| name: Release-plz release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - &checkout | |
| name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - &install-rust | |
| name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 | |
| # Generating a GitHub token, so that PRs and tags created by | |
| # the release-plz-action can trigger actions workflows. | |
| - name: Generate GitHub token | |
| uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 | |
| id: generate-token | |
| with: | |
| # GitHub App ID secret name | |
| app-id: ${{ secrets.GH_RELEASES_MANAGER_APP_ID }} | |
| # GitHub App private key secret name | |
| private-key: ${{ secrets.GH_RELEASES_MANAGER_APP_PRIVATE_KEY }} | |
| - name: Run release-plz | |
| uses: release-plz/action@1528104d2ca23787631a1c1f022abb64b34c1e11 # v0.5 | |
| with: | |
| command: release | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| # Create a PR with the new versions and changelog, preparing the next release. | |
| release-plz-pr: | |
| if: ${{ github.repository_owner == 'nearai' }} | |
| name: Release-plz PR | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: release-plz-${{ github.ref }} | |
| cancel-in-progress: false | |
| steps: | |
| - *checkout | |
| - *install-rust | |
| - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 | |
| - name: Generate GitHub token | |
| uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 | |
| id: generate-token | |
| with: | |
| app-id: ${{ secrets.GH_RELEASES_MANAGER_APP_ID }} | |
| private-key: ${{ secrets.GH_RELEASES_MANAGER_APP_PRIVATE_KEY }} | |
| - name: Run release-plz | |
| uses: release-plz/action@1528104d2ca23787631a1c1f022abb64b34c1e11 # v0.5 | |
| with: | |
| command: release-pr | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |