-
Notifications
You must be signed in to change notification settings - Fork 453
55 lines (45 loc) · 1.6 KB
/
pre-release-sha.yml
File metadata and controls
55 lines (45 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
on:
workflow_dispatch:
inputs:
ref:
description: 'Enter a full Git SHA to create a prerelease for'
required: true
name: Publish a pre-release version of the CLI from a SHA
jobs:
prerelease:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Check out specified ref (${{ inputs.ref }})
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Read primary Node version
id: node
run: echo "version=$(yq eval '.primary_node_version' .github/test-matrix.yml)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@v6
with:
node-version: ${{ steps.node.outputs.version }}
cache: npm
registry-url: 'https://registry.npmjs.org'
# Use npm@10 due to https://github.com/npm/cli/issues/8489 and https://github.com/npm/cli/issues/8767
- name: Setup npm version
run: npm install -g npm@10
- name: Install core dependencies
run: npm ci --no-audit
- name: Build project
run: npm run build
- name: Configure Git user
run: |
git config --global user.name "Netlify"
git config --global user.email "82042599+token-generator-app[bot]@users.noreply.github.com"
- name: Run npm version
run: |
npm --no-git-tag-version version "$(jq --raw-output .version package.json)-pre.$(git rev-parse --short ${{ inputs.ref }})"
- name: Run npm publish
run: npm publish --provenance --tag=rc
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}