Repository navigation
66 lines (61 loc) · 1.8 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (61 loc) · 1.8 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
56
57
58
59
60
61
62
63
64
65
66
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 0.1.3)'
required: true
type: string
permissions:
id-token: write
contents: write
env:
# The corpus-backed tests read the pinned testsuite (same ref as ci.yml).
TESTSUITE_REF: 85b7e19f3922aff76f4438f90d4148fd67ab1970
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v7
with:
repository: pubid/pubid-testsuite
ref: ${{ env.TESTSUITE_REF }}
path: pubid-testsuite
- uses: actions/setup-node@v7
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm test
env:
TESTSUITE_DIR: ${{ github.workspace }}/pubid-testsuite/tests
- name: Set version from workflow input (patch release)
if: github.event_name == 'workflow_dispatch'
run: |
current=$(node -p "require('./package.json').version")
if [ "$current" != "${{ inputs.version }}" ]; then
npm version ${{ inputs.version }} --no-git-tag-version
fi
- run: npm publish
github-release:
needs: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=v${{ inputs.version }}" >> "$GITHUB_OUTPUT"
else
echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.version.outputs.tag }}
generate_release_notes: true