Skip to content

Commit 4990281

Browse files
committed
ci: package bumps
1 parent a2e5ade commit 4990281

5 files changed

Lines changed: 42 additions & 21 deletions

File tree

.github/workflows/release.yml

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,72 @@
11
name: Release
22

33
on:
4-
pull_request:
54
push:
65
tags:
76
- "core-v*"
87
- "express-v*"
98

109
jobs:
11-
publish-stable:
12-
name: Publish Stable Release
10+
publish:
11+
name: Publish Package
1312
runs-on: ubuntu-latest
14-
if: startsWith(github.ref, 'refs/tags/core-v') || startsWith(github.ref, 'refs/tags/express-v')
13+
1514
permissions:
1615
contents: read
1716
id-token: write
1817

1918
steps:
2019
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
2122

2223
- uses: actions/setup-node@v4
2324
with:
2425
node-version: 20
2526
registry-url: https://registry.npmjs.org/
2627

27-
- name: Determine package
28-
id: pkg
28+
- name: Determine package and version
29+
id: meta
2930
run: |
30-
if [[ "${GITHUB_REF}" == refs/tags/core-v* ]]; then
31-
echo "package=core" >> $GITHUB_OUTPUT
32-
elif [[ "${GITHUB_REF}" == refs/tags/express-v* ]]; then
33-
echo "package=express" >> $GITHUB_OUTPUT
31+
TAG="${GITHUB_REF#refs/tags/}"
32+
33+
if [[ "$TAG" == core-v* ]]; then
34+
PACKAGE="core"
35+
VERSION="${TAG#core-v}"
36+
elif [[ "$TAG" == express-v* ]]; then
37+
PACKAGE="express"
38+
VERSION="${TAG#express-v}"
3439
else
35-
echo "Unknown tag format"
40+
echo "Invalid tag format"
41+
exit 1
42+
fi
43+
44+
echo "package=$PACKAGE" >> $GITHUB_OUTPUT
45+
echo "version=$VERSION" >> $GITHUB_OUTPUT
46+
47+
echo "Publishing $PACKAGE version $VERSION"
48+
49+
- name: Validate package.json version matches tag
50+
working-directory: packages/${{ steps.meta.outputs.package }}
51+
run: |
52+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
53+
if [ "$PACKAGE_VERSION" != "${{ steps.meta.outputs.version }}" ]; then
54+
echo "Version mismatch!"
55+
echo "Tag version: ${{ steps.meta.outputs.version }}"
56+
echo "package.json version: $PACKAGE_VERSION"
3657
exit 1
3758
fi
3859
3960
- name: Install dependencies
40-
working-directory: packages/${{ steps.pkg.outputs.package }}
61+
working-directory: packages/${{ steps.meta.outputs.package }}
4162
run: npm ci
4263

4364
- name: Build
44-
working-directory: packages/${{ steps.pkg.outputs.package }}
65+
working-directory: packages/${{ steps.meta.outputs.package }}
4566
run: npm run build
4667

47-
- name: Publish stable to npm
48-
working-directory: packages/${{ steps.pkg.outputs.package }}
68+
- name: Publish to npm
69+
working-directory: packages/${{ steps.meta.outputs.package }}
4970
run: npm publish --access public
5071
env:
5172
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

packages/core/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seamless-auth/core",
3-
"version": "0.1.1-beta.3",
3+
"version": "0.1.1",
44
"description": "Framework-agnostic core authentication logic for SeamlessAuth",
55
"license": "AGPL-3.0-only",
66
"author": "Fells Code, LLC",

packages/express/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seamless-auth/express",
3-
"version": "0.0.2-beta.21",
3+
"version": "0.0.2",
44
"description": "Express adapter for Seamless Auth passwordless authentication",
55
"license": "AGPL-3.0-only",
66
"type": "module",

0 commit comments

Comments
 (0)