Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: github actions to automated build & publish
- Loading branch information
1 parent
2e9806b
commit 0c7c7a0
Showing
4 changed files
with
92 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,14 @@ | ||
# .github/dependabot.yml | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
# `npm` value will detect `pnpm` usage | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,55 @@ | ||
# .github/workflows/build_and_publish.yml | ||
|
||
name: Build and Publish to NPM | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
# by default, permissions are read-only, read + write is required for git pushes | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: ASDF Parse | ||
uses: kota65535/github-asdf-parse-action@v1.1.0 | ||
id: versions | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "${{ steps.versions.outputs.nodejs }}" | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Conventional Changelog Action | ||
id: changelog | ||
uses: TriPSs/conventional-changelog-action@v3 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
version-file: "./package.json,./package-lock.json" | ||
output-file: "CHANGELOG.md" | ||
|
||
- name: Publish to NPM | ||
if: ${{ steps.changelog.outputs.skipped == 'false' }} | ||
run: npm publish | ||
env: | ||
# `gh secret set NPM_TOKEN --app actions --body $NPM_TOKEN` | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Github Release | ||
if: ${{ steps.changelog.outputs.skipped == 'false' }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
# output options: https://github.com/TriPSs/conventional-changelog-action#outputs | ||
body: ${{ steps.changelog.outputs.clean_changelog }} | ||
tag_name: ${{ steps.changelog.outputs.tag }} |
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,22 @@ | ||
name: Sync Repo Metadata | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Sync Repository Metadata | ||
# uses: kbrashears5/github-action-repo-sync@v1.0.0 | ||
uses: iloveitaly/github-action-repo-sync@python | ||
with: | ||
TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }} |
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 @@ | ||
nodejs 19.1.0 |
0c7c7a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lunchbag this needs some tokens from your end in order to work properly, can you add these?