Skip to content

Commit

Permalink
ci: Switch to manual release + only publish through pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
gutentag2012 committed Apr 5, 2024
1 parent f19f6e3 commit d0480ea
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name: CD

on:
push:
branches:
- main
paths:
- 'packages/**'
# Manually trigger a deployment
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
default: ''
release:
types:
- published

permissions:
contents: write
contents: read
id-token: write

jobs:
release:
Expand All @@ -28,11 +33,12 @@ jobs:
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm test
- run: git config --global user.name "Release Bot"
- run: git config --global user.email "release-bot<>"
- run: pnpm nx release --verbose --skip-publish
- run: |
# Use the version form the workflow input if it is set, otherwise use the version from the release
VERSION=${{ github.event.inputs.version || github.ref_name }}
pnpm nx release version --specifier $VERSION
pnpm nx release publish
name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git tag -d "v{version}" # Due to a bug in nx release, sometimes this tag gets created.
- run: git push --follow-tags
NPM_CONFIG_PROVENANCE: true

0 comments on commit d0480ea

Please sign in to comment.