fix: sdk-5211 correct ios release workflows #63
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: Publish new github release | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| types: | |
| - closed | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| permissions: | |
| contents: read # GitHub App token handles release writes | |
| name: Publish new release | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.event.pull_request.head.ref, 'release/') && github.event.pull_request.merged == true # only merged pull requests must trigger this job | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - name: Generate GitHub App Token | |
| id: generate-token | |
| uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 | |
| with: | |
| app-id: ${{ vars.RELEASE_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_PRIVATE_KEY }} | |
| permission-contents: write # to create releases and tags | |
| - name: Extract version from branch name (for release branches) | |
| id: extract-version | |
| env: | |
| BRANCH_NAME: ${{ github.event.pull_request.head.ref }} | |
| run: | | |
| VERSION="${BRANCH_NAME#release/}" | |
| echo "release_version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Publish GitHub release | |
| env: | |
| GH_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| VERSION: ${{ steps.extract-version.outputs.release_version }} | |
| run: | | |
| TAG="v${VERSION}" | |
| if gh release view "$TAG" --repo "${{ github.repository }}" >/dev/null 2>&1; then | |
| echo "Release $TAG already exists; nothing to publish." | |
| exit 0 | |
| fi | |
| gh release create "$TAG" \ | |
| --repo "${{ github.repository }}" \ | |
| --verify-tag \ | |
| --title "$TAG" \ | |
| --generate-notes \ | |
| --latest | |
| - name: Delete release branch | |
| uses: koj-co/delete-merged-action@63a03c35810a8a7d4840d18793c0f68ff8b59450 # master | |
| if: startsWith(github.event.pull_request.head.ref, 'release/') | |
| with: | |
| branches: 'release/*' | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |