Skip to content

Commit

Permalink
snapshot workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed May 31, 2024
1 parent c45e69a commit 00d9b9a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Snapshot release
run-name: Snapshot release by ${{ github.actor }}

on:
issue_comment:
types: [created]

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

jobs:
snapshot-release:
if: ${{ startsWith(github.event.comment.body, '!snapshot') && github.repository == 'clerk/javascript' && github.event.issue.pull_request }}
runs-on: ubuntu-latest
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL && fromJSON(vars.TIMEOUT_MINUTES_NORMAL) || 10 }}

permissions:
contents: read
id-token: write

steps:
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'npm'

- name: Checkout repo
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.issue.number }}/head

- name: Install NPM Dependencies
run: npm ci --audit=false --fund=false --prefer-offline
shell: bash

- name: Version packages for snapshot
id: version-packages
run: npm run version:snapshot | tail -1 >> "$GITHUB_OUTPUT"

- name: Build astro-clerk-auth
if: steps.version-packages.outputs.success == '1'
timeout-minutes: 5
run: npx turbo build --filter='astro-clerk-auth'

- name: Snapshot release
if: steps.version-packages.outputs.success == '1'
run: npm run release:snapshot
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"changeset": "changeset",
"release": "changeset publish && git push --follow-tags"
"release": "changeset publish && git push --follow-tags",
"version:snapshot": "changeset version --snapshot",
"release:snapshot": "changeset publish --tag snapshot --no-git-tag"
},
"devDependencies": {
"eslint-config-custom": "*",
Expand Down

0 comments on commit 00d9b9a

Please sign in to comment.