Snapshot release by panteliselef #69
This file contains 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
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 == 'panteliselef/astro-with-clerk-auth' && github.event.issue.pull_request }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
ref: refs/pull/${{ github.event.issue.number }}/head | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
- name: Install NPM Dependencies | |
run: npm ci --audit=false --fund=false --prefer-offline | |
shell: bash | |
- name: Version packages for snapshot | |
id: version-packages | |
run: | | |
touch .changeset/snap.md && echo -e "---\n'astro-clerk-auth': patch\n---\n\nSnapshot release" > .changeset/snap.md | |
cat .changeset/snap.md | |
npm run version:snapshot | |
- name: Build astro-clerk-auth | |
timeout-minutes: 5 | |
run: npx turbo build --filter='astro-clerk-auth' | |
- name: Create .npmrc | |
run: touch .npmrc && echo -e "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}\n" >> .npmrc | |
- name: Snapshot release | |
run: npm run release:snapshot | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_CONFIG_PROVENANCE: true |