generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 126
53 lines (51 loc) · 1.83 KB
/
snapshot-release.yml
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
name: Snapshot release
run-name: 'Snapshot release ${{ inputs.version }}'
on:
workflow_dispatch:
inputs:
version:
description: Base version to use for the release
type: string
default: '0.0.0'
env:
FORCE_COLOR: 3 # Diplay chalk colors
jobs:
snapshot:
name: Deployment
runs-on: ubuntu-24.04
permissions:
id-token: write # to enable use of OIDC for NPM provenance
steps:
- name: Generate snapshot version
id: version
run: |
version="${{ inputs.version }}-snapshot.$(date +%Y-%m-%d).$(echo $GITHUB_SHA | cut -c1-8)"
echo "version=${version}" >> $GITHUB_OUTPUT
echo "::notice title=Version::${version}"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install --ignore-scripts --frozen-lockfile --filter nuqs...
- name: Build package
run: pnpm build --filter nuqs
- name: Publish package
working-directory: packages/nuqs
run: |
pnpm pkg set version=${{ steps.version.outputs.version }}
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
pnpm publish --access public --provenance --tag snapshot --no-git-checks
rm -f .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: 47ng/actions-slack-notify@main
name: Notify on Slack
if: failure()
with:
status: ${{ job.status }}
jobName: Snapshot release ${{ steps.version.outputs.version }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}