Skip to content

Commit

Permalink
Publish snapshots of the modern packages on every commit
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed Mar 8, 2024
1 parent b3d3f98 commit 069e000
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"fixed": [["@solana/!({*-impl,build-scripts,test-*,tsconfig,web3.js-legacy-sham})"]],
"ignore": ["@solana/web3.js"],
"linked": [],
"snapshot": {
"prereleaseTemplate": "{tag}-{datetime}.{commit}",
"useCalculatedVersion": true
},
"privatePackages": false,
"updateInternalDependencies": "patch"
}
57 changes: 57 additions & 0 deletions .github/workflows/publish-prerelease-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish Package Snapshots

on:
workflow_dispatch:
branches:
- master
push:
branches:
- master

env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'
# Enables Turborepo Remote Caching.
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
build-and-publish-snapshots-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies

- name: Setup Solana Test Validator
id: start-test-validator
uses: ./.github/workflows/actions/setup-validator

- name: Run Build Step (force)
run: pnpm turbo build --concurrency=100% --filter=\!@solana/web3.js --force=true

- name: Stop Test Validator
if: always() && steps.start-test-validator.outcome == 'success'
run: kill ${{ steps.start-test-validator.outputs.pid }}

- name: Configure NPM token
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Snapshots
run: |
pnpm changeset pre exit
find packages/* -maxdepth 0 -type d -print0 | \
xargs -t0 -n 1 -P $(nproc) -I {} \
sh -c 'cd {} && pnpm pkg delete devDependencies'
pnpm changeset version --snapshot experimental
pnpm turbo publish-packages --concurrency=100% --filter=\!@solana/web3.js
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 069e000

Please sign in to comment.