v4.1.22-alpha.1 #913
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
| # When making a release, please keep in mind that this action expects and validates a few things: | |
| # - Releases marked as drafts will be ignored (ie. they will not publish). | |
| # - Ensure that package.json has a version. | |
| # - Ensure the git tag you create during the release process starts with a v (ie. v1.2.3). | |
| # - Ensure that the version in package.json matches the release tag created. | |
| # - Ensure versions are valid semver format. | |
| # - Ensure the GitHub release is marked as a pre-release if the semver version has a pre-release tag. | |
| # This script was inspired by this README: https://github.com/marketplace/actions/github-releases-for-automated-package-publishing | |
| name: Publish Package to npmjs | |
| on: | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| id-token: write | |
| env: | |
| NODE_VERSION: 22.18 | |
| EVM_ARTIFACTS_PATHS: | | |
| artifacts | |
| cache | |
| typechain | |
| out | |
| cache-foundry | |
| SVM_ARTIFACTS_PATHS: | | |
| target/idl | |
| target/types | |
| src/svm/assets | |
| src/svm/clients | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Note we set an `id` called `release`. We'll use that later... | |
| - name: Validate and extract release information | |
| id: release | |
| uses: manovotny/[email protected] | |
| # Enable npm trusted publishing (OIDC) for releases | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "${{ env.NODE_VERSION }}" | |
| registry-url: "https://registry.npmjs.org" | |
| cache: "yarn" | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - name: Install packages | |
| run: yarn install --frozen-lockfile | |
| - name: Cache EVM artifacts | |
| id: evm-artifacts-cache | |
| uses: ./.github/actions/cache-evm-artifacts | |
| with: | |
| node_version: ${{ env.NODE_VERSION }} | |
| - name: Generate EVM artifacts | |
| if: steps.evm-artifacts-cache.outputs.cache-hit != 'true' | |
| uses: ./.github/actions/generate-evm-artifacts | |
| with: | |
| path: ${{ env.EVM_ARTIFACTS_PATHS }} | |
| node_version: ${{ env.NODE_VERSION }} | |
| - name: Cache SVM artifacts | |
| id: svm-artifacts-cache | |
| uses: ./.github/actions/cache-svm-artifacts | |
| with: | |
| type: artifacts | |
| node_version: ${{ env.NODE_VERSION }} | |
| - name: Generate SVM artifacts | |
| if: steps.svm-artifacts-cache.outputs.cache-hit != 'true' | |
| uses: ./.github/actions/generate-svm-artifacts | |
| with: | |
| type: artifacts | |
| path: ${{ env.SVM_ARTIFACTS_PATHS }} | |
| node_version: ${{ env.NODE_VERSION }} | |
| - name: Build dist package | |
| run: yarn build-ts | |
| # The last two steps will publish the package. Note that we're using | |
| # information from the `release` step above (I told you we'd use it | |
| # later). Notice the `if` statements on both steps... | |
| # | |
| # If there *is* a tag (ie. `beta`, `canary`, etc.), we publish a | |
| # "pre-release" or "tagged" version of a package (ie. 1.2.3-beta.1). | |
| # | |
| # If there *is not* a tag (ie. `beta`, `canary`, etc.), we publish a | |
| # version of a package (ie. 1.2.3). | |
| # | |
| # This workflow publishes via npm using GitHub's OIDC integration for | |
| # trusted publishing, so no long-lived tokens are required. | |
| # This will publish a "pre-release" or "tagged" version of a package. | |
| # This will publish a version of a package. | |
| - name: Publish version | |
| if: steps.release.outputs.tag == '' | |
| run: npm publish | |
| env: | |
| NPM_CONFIG_PROVENANCE: "false" | |
| - name: Publish tagged version | |
| if: steps.release.outputs.tag != '' | |
| run: npm publish --tag ${{ steps.release.outputs.tag }} | |
| env: | |
| NPM_CONFIG_PROVENANCE: "false" | |
| # Due to GitHub cache scoping, we cannot easily share the cache between releases even if the cache key is the same. | |
| # In order to not slow down the NPM package publishing, we move the building of SVM binaries for GitHub release to a | |
| # separate jobs that runs in parallel. | |
| release-svm-production: | |
| name: Release SVM production binaries on GitHub | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Anchor & Solana | |
| uses: ./.github/actions/setup-solana-anchor | |
| with: | |
| verify_version: 0.4.3 | |
| node_version: ${{ env.NODE_VERSION }} | |
| - name: Create verified production build | |
| run: yarn build-svm-solana-verify | |
| - name: Archive verified production build | |
| run: tar -czf svm-verified-production-binaries.tar.gz target/deploy | |
| - name: Release verified production binaries | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: svm-verified-production-binaries.tar.gz | |
| release-svm-test: | |
| name: Release SVM test binaries on GitHub | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Anchor & Solana | |
| uses: ./.github/actions/setup-solana-anchor | |
| with: | |
| verify_version: 0.4.3 | |
| node_version: ${{ env.NODE_VERSION }} | |
| - name: Create verified test build | |
| env: | |
| IS_TEST: true | |
| run: yarn build-svm-solana-verify | |
| - name: Archive verified test build | |
| run: tar -czf svm-verified-test-binaries.tar.gz target/deploy | |
| - name: Release verified test binaries | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: svm-verified-test-binaries.tar.gz |