Release #34
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: | |
| schedule: | |
| - cron: '0 0 1 * *' # Run at 00:00 UTC on the 1st of every month. | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: true | |
| env: | |
| RELEASE_BRANCH: release | |
| jobs: | |
| create-git-branch-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/composites/git-config | |
| - name: Remove submodule to improve Swift Package experience | |
| env: | |
| SUBMODULE_PATH: Submodule/github/rest-api-description | |
| run: | | |
| if [ -d "$SUBMODULE_PATH" ]; then | |
| # | |
| git checkout -B $RELEASE_BRANCH | |
| # | |
| git rm $SUBMODULE_PATH | |
| git commit -m "Remove submodule to improve Swift Package experience" | |
| git push --set-upstream origin $RELEASE_BRANCH | |
| else | |
| echo "::error ::Submodule not found, skipping removal." | |
| exit 1 | |
| fi | |
| create-github-release: | |
| needs: create-git-branch-release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: Wei18/GitHubSwiftActions/Actions/Release@1.0.9 | |
| with: | |
| owner: ${{ github.repository_owner }} | |
| repo: ${{ github.event.repository.name }} | |
| token: ${{ github.token }} | |
| ref: ${{ env.RELEASE_BRANCH }} | |
| type: "patch" | |
| create-pull-request: | |
| needs: create-github-release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ env.RELEASE_BRANCH }} | |
| fetch-depth: 2 | |
| - uses: ./.github/composites/git-config | |
| - name: Revert previous commit | |
| run: | | |
| # | |
| git revert --no-edit HEAD | |
| git push | |
| - name: Create pull request | |
| run: | | |
| PR_URL="$(gh pr create --head $RELEASE_BRANCH --title 'Bump patch version' --body 'Automated monthly release merge')" | |
| echo "PR_URL=$PR_URL" >> $GITHUB_ENV | |
| - name: "Update pr metadata" | |
| run: | | |
| gh pr merge --auto --merge "$PR_URL" | |
| gh pr review --approve "$PR_URL" |