feat: update gh actions #43
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 release | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - "master" | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| release_gh: | |
| name: Create new GitHub release | |
| if: contains(github.event.pull_request.labels.*.name, 'release') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: git config | |
| run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| - name: Generate Changelog | |
| run: node ./scripts/extract_changelog.js > ${{ github.workspace }}-CURRENT_CHANGELOG.md | |
| - name: Get latest version | |
| run: echo "PACKAGE_VERSION=$(node scripts/extract_version.js)" >> $GITHUB_ENV | |
| - name: Download dSYMs | |
| env: | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| url=$(echo "$PR_BODY" | grep -oE 'https://[^ )]*dSYMs\.zip' | head -n 1) | |
| if [ -n "$url" ]; then | |
| echo "Found dSYMs URL: $url" | |
| curl -L -o dSYMs.zip "$url" | |
| else | |
| echo "No dSYMs.zip URL found in PR body." | |
| fi | |
| - name: GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| FILES="" | |
| if [ -f dSYMs.zip ]; then | |
| FILES="dSYMs.zip" | |
| fi | |
| gh release create v${{ env.PACKAGE_VERSION }} \ | |
| --title "freeRASP ${{ env.PACKAGE_VERSION }}" \ | |
| --notes-file ${{ github.workspace }}-CURRENT_CHANGELOG.md \ | |
| $FILES | |
| publish_npmjs: | |
| name: Publish release to npm.js | |
| needs: release_gh | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Configure git | |
| run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| - name: Publish package | |
| run: npm publish |