Repository navigation
Merge pull request #859 from bemusic/release-candidate/proposed #52
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: CD | |
| on: | |
| push: | |
| branches: | |
| - master | |
| env: | |
| GIT_AUTHOR_NAME: Aki running on GitHub Actions | |
| GIT_AUTHOR_EMAIL: aki@spacet.me | |
| GIT_COMMITTER_NAME: Aki running on GitHub Actions | |
| GIT_COMMITTER_EMAIL: aki@spacet.me | |
| jobs: | |
| cd: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get token | |
| id: get-token | |
| run: | | |
| export GH_TOKEN="$(npx obtain-github-app-installation-access-token ci $GH_APP_CREDENTIALS_TOKEN)" | |
| echo "::add-mask::$GH_TOKEN" | |
| echo "token=$GH_TOKEN" > $GITHUB_OUTPUT | |
| env: | |
| GH_APP_CREDENTIALS_TOKEN: ${{ secrets.GH_APP_CREDENTIALS_TOKEN }} | |
| - name: Checkout Repository | |
| uses: actions/checkout@v7 | |
| with: | |
| token: ${{ steps.get-token.outputs.token }} | |
| - name: Set up project | |
| uses: ./.github/actions/setup-project | |
| - name: Update version | |
| run: node build-scripts update-version --confirm | |
| id: update | |
| - name: Create branch and pull request | |
| if: steps.update.outputs.version | |
| run: | | |
| git checkout -b release-candidate/proposed | |
| git add -A | |
| git commit -m ":bookmark: ${{ steps.update.outputs.version }}" | |
| git push -u origin release-candidate/proposed --force | |
| gh pr create --title "$PR_TITLE" --body "$PR_BODY" --base master || gh pr edit --title "$PR_TITLE" --body "$PR_BODY" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.get-token.outputs.token }} | |
| PR_TITLE: 'Release candidate - v${{ steps.update.outputs.version }}' | |
| PR_BODY: | | |
| This is a release candidate for version ${{ steps.update.outputs.version }}. |