-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5447ce3
commit f4363a6
Showing
3 changed files
with
91 additions
and
0 deletions.
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,54 @@ | ||
name: Publish package | ||
|
||
on: workflow_dispatch | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
publish_package: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Bun | ||
uses: oven-sh/setup-bun@v1 | ||
|
||
- id: changelog | ||
name: Generate changelog | ||
run: bun scripts/generate-changelog.ts | ||
|
||
- name: Install modules | ||
run: bun install | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Build package | ||
run: bun run prepublishOnly | ||
|
||
- name: Run publint | ||
run: bunx publint | ||
|
||
- name: Publish package | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: v${{ steps.changelog.outputs.version }} | ||
name: v${{ steps.changelog.outputs.version }} | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
draft: false | ||
prerelease: false | ||
generateReleaseNotes: true |
Submodule esbuild-plugin-autoload
added at
68c2af
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,36 @@ | ||
import { execSync } from "node:child_process"; | ||
import { randomUUID } from "node:crypto"; | ||
import { appendFileSync } from "node:fs"; | ||
import { EOL } from "node:os"; | ||
|
||
function getLatestTag() { | ||
try { | ||
return execSync("git describe --abbrev=0 --tags").toString().trim(); | ||
} catch (e) { | ||
console.warn(e); | ||
return execSync("git rev-list --max-parents=0 HEAD").toString().trim(); | ||
} | ||
} | ||
|
||
const commits = execSync( | ||
`git log ${getLatestTag()}..HEAD --pretty="format:%s%b"`, | ||
) | ||
.toString() | ||
.trim() | ||
.split("\n") | ||
.reverse(); | ||
|
||
console.log(getLatestTag(), commits); | ||
|
||
const version = execSync("npm pkg get version").toString().replace(/"/gi, ""); | ||
|
||
const delimiter = `---${randomUUID()}---${EOL}`; | ||
|
||
if (process.env.GITHUB_OUTPUT) | ||
appendFileSync( | ||
process.env.GITHUB_OUTPUT, | ||
`changelog<<${delimiter}${commits.join( | ||
EOL.repeat(2), | ||
)}${EOL}${delimiter}version=${version}${EOL}`, | ||
); | ||
else console.log("Not github actions"); |