Skip to content

Commit e962b77

Browse files
committed
ci: add pre-release-sha workflow
1 parent 97f3a58 commit e962b77

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/pre-release-sha.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
ref:
6+
description: 'Enter a full Git SHA to create a prerelease for'
7+
required: true
8+
9+
name: Publish a pre-release version of the CLI from a SHA
10+
11+
jobs:
12+
prerelease:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
16+
contents: write
17+
steps:
18+
- name: Check out specified ref (${{ inputs.ref }})
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ inputs.ref }}
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '18.17.0'
26+
cache: npm
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: Install core dependencies
30+
run: npm ci --no-audit
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Configure Git user
36+
run: |
37+
git config --global user.name "Netlify"
38+
git config --global user.email "82042599+token-generator-app[bot]@users.noreply.github.com"
39+
40+
- name: Run npm version
41+
run: npm --no-git-tag-version version "\$(jq --raw-output .version package.json)-pre.\$(git rev-parse --short ${{ inputs.ref }})"
42+
43+
- name: Run npm publish
44+
run: npm publish --provenance
45+
env:
46+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)