-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto-publish on push to
release
branch
- Loading branch information
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- release | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
cache: pnpm | ||
- run: pnpm install | ||
- run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
git config --global user.email "firefoxic.dev@gmail.com" | ||
git config --global user.name "firefoxic" | ||
version_type=$(node scripts/determine-version.js) | ||
if [ -n "$version_type" ]; then | ||
pnpm version ${version_type} | ||
pnpm publish --provenance --access public --no-git-checks | ||
fi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { cwd } from "node:process" | ||
import { join } from "node:path" | ||
import { readFileSync } from "node:fs" | ||
|
||
let changelogPath = join(cwd(), `CHANGELOG.md`) | ||
let changelog = readFileSync(changelogPath, `utf-8`) | ||
let unreleasedSection = changelog.split(`## [Unreleased]`)[1].split(`## [`)[0] | ||
let versionType = `` | ||
|
||
if (unreleasedSection.includes(`### Changed`)) { | ||
versionType = `major` | ||
} else if (unreleasedSection.includes(`### Added`)) { | ||
versionType = `minor` | ||
} else if (unreleasedSection.includes(`### Fixed`)) { | ||
versionType = `patch` | ||
} | ||
|
||
console.log(versionType) |