File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ name: Publish package
22
33on :
44 push :
5- branches :
6- - main
7- workflow_dispatch :
5+ tags :
6+ - ' v*'
87
98permissions :
109 contents : read
3231 - name : Install dependencies
3332 run : pnpm install --frozen-lockfile
3433
34+ - name : Set package version from tag
35+ run : |
36+ VERSION="${GITHUB_REF_NAME#v}"
37+ if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
38+ echo "Tag must be a semantic version prefixed with v (for example, v1.2.3)."
39+ exit 1
40+ fi
41+ pnpm version "$VERSION" --no-git-tag-version
42+
3543 - name : Build package
3644 run : pnpm run build
3745
Original file line number Diff line number Diff line change 1+ # @originprotocol/squid-utils
2+
3+ Shared utilities for Origin Protocol Subsquid projects.
4+
5+ ## Publishing
6+
7+ Packages are published to GitHub Packages by the ` Publish package ` GitHub
8+ Actions workflow.
9+
10+ 1 . Create a GitHub Release with a semantic-version tag such as ` v1.2.3 ` .
11+ 2 . Publish the release. Creating the tag triggers the publish workflow.
12+ 3 . The workflow removes the ` v ` prefix, sets the package version to ` 1.2.3 ` ,
13+ builds the package, and publishes it to GitHub Packages.
14+
15+ Each version can be published only once. Use a new tag for every release.
You can’t perform that action at this time.
0 commit comments