Release ruby.wasm #105
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 ruby.wasm | |
| on: | |
| schedule: | |
| - cron: "0 15 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| tag-name: | |
| type: string | |
| description: "Release tag" | |
| required: true | |
| type: | |
| type: choice | |
| description: "Release type" | |
| required: true | |
| options: | |
| - "nightly" | |
| - "stable" | |
| push: | |
| tags: ["*"] | |
| jobs: | |
| create-tag: | |
| if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| outputs: | |
| tag-name: ${{ steps.generate-tag.outputs.TAG_NAME }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: git config | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| - id: generate-tag | |
| run: | | |
| MANUAL_TAG="${{ inputs.tag-name }}" | |
| echo "TAG_NAME=${MANUAL_TAG:-$(date +'%Y-%m-%d')-a}" >> $GITHUB_OUTPUT | |
| - uses: ruby/setup-ruby@v1 | |
| if: ${{ inputs.type == 'stable' }} | |
| with: | |
| ruby-version: "3.4" | |
| - run: rake 'bump_version[${{ steps.generate-tag.outputs.TAG_NAME }}]' | |
| if: ${{ inputs.type == 'stable' }} | |
| - run: git commit -am "Release ${{ steps.generate-tag.outputs.TAG_NAME }}" | |
| if: ${{ inputs.type == 'stable' }} | |
| - run: git tag "${{ steps.generate-tag.outputs.TAG_NAME }}" | |
| - run: git push origin "${{ steps.generate-tag.outputs.TAG_NAME }}" | |
| - run: git push origin HEAD:main | |
| if: ${{ inputs.type == 'stable' }} | |
| # For nightly releases, we just build and publish npm packages | |
| release-nightly-npm-packages: | |
| if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'nightly') }} | |
| needs: | |
| - create-tag | |
| permissions: | |
| contents: write | |
| id-token: write | |
| packages: write | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| publish: true | |
| prerel_name: ${{ needs.create-tag.outputs.tag-name }} | |
| secrets: inherit | |
| # For stable releases, we build and publish npm packages, ruby_wasm gem, and js gem | |
| release-tag-npm-packages: | |
| if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'stable') }} | |
| needs: | |
| - create-tag | |
| permissions: | |
| contents: write | |
| id-token: write | |
| packages: write | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| publish: true | |
| prerel_name: ${{ needs.create-tag.outputs.tag-name || github.ref_name }} | |
| secrets: inherit | |
| release-tag-ruby_wasm-gem: | |
| if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'stable') }} | |
| needs: | |
| - create-tag | |
| permissions: | |
| contents: write | |
| id-token: write | |
| packages: write | |
| uses: ./.github/workflows/build-gems.yml | |
| with: | |
| publish: true | |
| ref: ${{ needs.create-tag.outputs.tag-name || github.ref_name }} | |
| secrets: inherit | |
| release-tag-js-gem: | |
| if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'stable') }} | |
| runs-on: ubuntu-24.04 | |
| needs: | |
| - create-tag | |
| permissions: | |
| contents: write | |
| id-token: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ needs.create-tag.outputs.tag-name || github.ref_name }} | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| - uses: rubygems/configure-rubygems-credentials@v1.0.0 | |
| - run: | | |
| cd packages/gems/js | |
| gem build | |
| gem push js-*.gem |