Skip to content

Commit

Permalink
tweak release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Feb 20, 2024
1 parent 18c197d commit cdde2d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,11 @@ jobs:
--filter './contrib/**' \
run test
- name: Tag & Create GitHub Releases
env:
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} # for GitHub CLI
run: pnpm run tag-and-release

- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run publish

# Must happen before tag-and-release. Would prefer to do it after as a
# `continue-on-error:true` optional task, in case pushing back to main fails,
# but the tag-and-release script expects everything to be ready.
# RELEASE_GITHUB_TOKEN must have permissions to push to protected branches
- name: Sync Repos
# Don't mark the whole workflow as failed if this set fails
continue-on-error: true

#
# RELEASE_GITHUB_TOKEN must have permissions to push to protected branches
#
run: |
echo "Pulling latest and rebasing version-bump commit atop..."
git pull --rebase
Expand All @@ -109,9 +97,18 @@ jobs:
echo "Updating subrepo configs..."
pnpm run meta:update
git commit -m 'meta:update'
echo "Pushing..."
git push
echo "Syncing subrepos with latest commits..."
echo "(Will record new state of subrepos on HEAD and push...)"
pnpm run sync-repos
- name: Tag & Create GitHub Releases
env:
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} # for GitHub CLI
run: pnpm run tag-and-release

- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run publish
6 changes: 2 additions & 4 deletions scripts/src/tag-and-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { execLive } from '@fullcalendar-scripts/standard/utils/exec'
import { getSubrepos, readManifest } from './meta/utils.js'
import { changelogSrc, getChangelogEntry } from './version-notes.js'

const TAG_POSTFIX = '-test'

export default async function() {
const monorepoDir = process.cwd()
const monorepoManifest = await readManifest(monorepoDir)
Expand Down Expand Up @@ -41,7 +39,7 @@ export default async function() {

async function tagAndReleaseRoot(monorepoDir: string, version: string): Promise<void> {
const execOpts = { cwd: monorepoDir }
const tagName = `v${version}${TAG_POSTFIX}`
const tagName = `v${version}`

console.log(`Creating root tag ${tagName}...`)
await execLive(['git', 'tag', '-a', tagName, '-m', tagName], execOpts)
Expand Down Expand Up @@ -71,7 +69,7 @@ async function tagAndReleaseSubrepo(
}

const execOpts = { cwd: monorepoDir }
const tagName = `v${version}${TAG_POSTFIX}`
const tagName = `v${version}`
const tempTagName = `subrepo/${subrepoSubdir}/${tagName}`
const subrepoRemote = subrepo['remote-url']
const subrepoCommit = subrepo['pulled-commit']
Expand Down

0 comments on commit cdde2d4

Please sign in to comment.