From f517adc1746cda094b3b4edcaf122107dbcaf2da Mon Sep 17 00:00:00 2001 From: "italiano@oplabs.co" Date: Thu, 21 Nov 2024 15:14:07 -0500 Subject: [PATCH] Publish snapshots --- .github/workflows/release-snapshot.yml | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release-snapshot.yml diff --git a/.github/workflows/release-snapshot.yml b/.github/workflows/release-snapshot.yml new file mode 100644 index 0000000..72fa525 --- /dev/null +++ b/.github/workflows/release-snapshot.yml @@ -0,0 +1,50 @@ +name: Release snapshot + +on: + workflow_dispatch: + push: + branches: + - main + - snapshots + +jobs: + publish-snapshot: + name: Publish snapshot release to npm + if: github.repository == 'ethereum-optimism/super-cli' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - uses: pnpm/action-setup@v2 + + - uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + registry-url: https://registry.npmjs.org + cache: pnpm + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + + - name: Set deployment token + run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Verify NPM Token is valid + run: npm whoami + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish snapshots + uses: seek-oss/changesets-snapshot@v0 + with: + pre-publish: pnpm nx run-many --target=build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file