Skip to content

Commit

Permalink
fix release script (#662)
Browse files Browse the repository at this point in the history
* Fix release script

* Use v3.1.0-alpha.52 constraints

* use atomic push
  • Loading branch information
mike-marcacci authored May 8, 2024
1 parent 183e275 commit 0e8a66f
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 148 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
steps:
- name: Checkout
uses: actions/[email protected]
- name: Use Node 20
- name: Use Node 22
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "22.x"
- name: Cache node modules
uses: actions/[email protected]
with:
Expand Down
78 changes: 0 additions & 78 deletions .github/workflows/main.yml

This file was deleted.

59 changes: 55 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,69 @@
name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
required: true

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432

steps:
# Validate the version input
- name: Validate version
run: |
if ! [[ ${{ github.event.inputs.version }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\._-]+)?$ ]]; then
echo "Invalid version tag. Please use the format v1.2.3."
exit 1
fi
# Checkout the code
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm

# Set up Node.js
- uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: "https://registry.npmjs.org"

# Install, build, list, and test
- run: npm ci
- run: npm publish --provenance --access public
- run: npm run build
- run: npm run lint
- run: node scripts/generate-keys.js && npm run test
env:
PORT: 12000
PGHOST: 127.0.0.1
PGUSER: postgres
PGPASSWORD: postgres
PGPORT: 5432
PGSSL: false

# Bump the version
- run: npx lerna version --no-git-tag-version -y "${{ github.event.inputs.version }}"
- run: npm run format

# Commit and push
- run: |
git config --global user.name 'Github Actions'
git config --global user.email 'githubactions'
git commit -am "v$VERSION"
git tag -f -a "v$VERSION" -m "v$VERSION"
git branch -va
git push --atomic origin HEAD:main refs/tags/${{ github.event.inputs.version }}
- run: git push --follow-tags

# Publish the package to NPM
- run: npx lerna exec -- npm publish --access public --tag "${{ github.event.inputs.version }}"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
64 changes: 32 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/authx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"bugs": "https://github.com/the-control-group/authx/issues",
"dependencies": {
"@authx/scopes": "*",
"@authx/scopes": "3.1.0-alpha.52",
"@types/auth-header": "^1.0.6",
"@types/graphql-relay": "^0.7.0",
"@types/jsonwebtoken": "^9.0.6",
Expand Down
Loading

0 comments on commit 0e8a66f

Please sign in to comment.