Release #206
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: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| type: choice | |
| description: Tag | |
| required: true | |
| options: | |
| - beta | |
| - latest | |
| - alpha | |
| # pull_request: | |
| # branches: | |
| # - develop | |
| # paths: | |
| # - .github/workflows/release.yaml | |
| # - src/** | |
| # - bin/** | |
| # - yarn.lock | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write | |
| actions: write | |
| jobs: | |
| build-publish: | |
| name: Build & publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cancel previous runs | |
| uses: styfle/cancel-workflow-action@0.5.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install Yarn | |
| run: corepack enable | |
| # Yarn dependencies cannot be cached until yarn is installed | |
| # WORKAROUND: https://github.com/actions/setup-node/issues/531 | |
| - name: Extract cached dependencies | |
| uses: actions/setup-node@v4 | |
| with: | |
| cache: yarn | |
| - name: Install | |
| run: yarn install --immutable | |
| - name: Build | |
| run: yarn build | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - name: Release | |
| run: npm publish --tag ${{ github.event.inputs.tag }} --access public | |
| - name: Get version | |
| id: package-version | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.package-version.outputs.version }} | |
| name: v${{ steps.package-version.outputs.version }} | |
| generate_release_notes: true | |
| prerelease: ${{ github.event.inputs.tag != 'latest' }} | |
| # - name: Build packages | |
| # run: | | |
| # yarn pkg:build | |
| # yarn pkg:compress | |
| # | |
| # - name: Get version | |
| # id: package-version | |
| # uses: martinbeentjes/npm-get-version-action@main | |
| # | |
| # - name: Tag release | |
| # uses: tvdias/github-tagger@v0.0.1 | |
| # with: | |
| # repo-token: ${{ github.token }} | |
| # tag: v${{ steps.package-version.outputs.current-version }} | |
| # | |
| # - name: Create release page | |
| # uses: softprops/action-gh-release@v1 | |
| # with: | |
| # files: 'package/*' | |
| # tag_name: v${{ steps.package-version.outputs.current-version }} | |
| # | |
| # - name: Checkout subsquid/homebrew-cli | |
| # uses: actions/checkout@v3 | |
| # with: | |
| # repository: subsquid/homebrew-cli | |
| # path: homebrew-cli | |
| # token: ${{ secrets.HOMEBREW_GITHUB_TOKEN }} | |
| # | |
| # - name: Gen Formula | |
| # run: | | |
| # echo pkg_macos_shasum=$(shasum -a256 ./package/subsquid-cli-$npm_package_version-macos-x64.tar.gz | cut -f 1 -d " ") >> $GITHUB_ENV | |
| # echo pkg_linux_shasum=$(shasum -a256 ./package/subsquid-cli-$npm_package_version-linux-x64.tar.gz | cut -f 1 -d " ") >> $GITHUB_ENV | |
| # source ./homebrew-cli/gen-formula.sh | |
| # cp sqd@$npm_package_version.rb ./homebrew-cli/Formula | |
| # cp sqd@$version_tag.rb ./homebrew-cli/Formula | |
| # if [ "$version_tag" = "latest" ]; then cp sqd.rb ./homebrew-cli/Formula; fi | |
| # env: | |
| # npm_package_version: ${{ steps.package-version.outputs.current-version }} | |
| # version_tag: ${{ github.event.inputs.tag }} | |
| # | |
| # - name: Pushes to another repository | |
| # uses: cpina/github-action-push-to-another-repository@main | |
| # env: | |
| # API_TOKEN_GITHUB: ${{ secrets.HOMEBREW_GITHUB_TOKEN }} | |
| # with: | |
| # source-directory: 'homebrew-cli' | |
| # destination-github-username: 'subsquid' | |
| # destination-repository-name: 'homebrew-cli' | |
| # user-name: 'github-actions' | |
| # user-email: 'github-actions@github.com' | |
| # target-branch: master | |
| # commit-message: 'release: v${{ steps.package-version.outputs.current-version }}' |