Skip to content

Commit

Permalink
chore: add canary release workflow (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Sep 11, 2024
1 parent 97d3219 commit 3a60cd6
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 54 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release Canary

on: workflow_dispatch

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

permissions:
contents: read # for checkout

jobs:
release-canary:
permissions:
contents: read # for checkout
id-token: write # to enable use of OIDC for npm provenance
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.ECOSPARK_APP_ID }}
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: canary
token: ${{ steps.generate-token.outputs.token }}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- run: pnpm install --ignore-scripts
- run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
- name: release canary & commit + push the changed versions
env:
NPM_CONFIG_PROVENANCE: true
run: |
pnpm release:canary
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore(release): publish canary [skip ci]"
git push
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lint:fix": "pnpm lint -- --fix",
"prepare": "husky",
"preview": "turbo run preview",
"release:canary": "zx scripts/release-canary.mjs",
"storybook:visual-editing": "turbo run build --filter='@sanity/visual-editing^...' && turbo watch dev storybook --filter='@sanity/visual-editing...'",
"test": "turbo run test"
},
Expand Down Expand Up @@ -48,7 +49,8 @@
"prettier-plugin-tailwindcss": "0.6.6",
"pretty-quick": "^4.0.0",
"turbo": "2.1.1",
"typescript": "5.6.2"
"typescript": "5.6.2",
"zx": "^8.1.5"
},
"packageManager": "[email protected]",
"pnpm": {
Expand Down
Loading

0 comments on commit 3a60cd6

Please sign in to comment.