-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: github actions prepping for auto releases
- Loading branch information
Showing
5 changed files
with
141 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,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" # Location of package manifests | ||
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,40 @@ | ||
name: commitlint | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install required dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y sudo | ||
sudo apt install -y git curl | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- name: node setup | ||
run: npm i | ||
- name: Print versions | ||
run: | | ||
git --version | ||
node --version | ||
npm --version | ||
npx commitlint --version | ||
- name: Validate current commit (last commit) with commitlint | ||
if: github.event_name == 'push' | ||
run: npx commitlint --last --verbose | ||
|
||
- name: Validate PR commits with commitlint | ||
if: github.event_name == 'pull_request' | ||
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose |
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,28 @@ | ||
# TODO: ENABLE / UNCOMMENT WHEN NPM_TOKEN IS SET in secrets REPO | ||
# name: publish | ||
|
||
# on: | ||
# push: | ||
# tags: | ||
# - "v*" | ||
|
||
# jobs: | ||
# tests: | ||
# uses: ./.github/workflows/tests.yml | ||
# publish-npm: | ||
# needs: [tests] | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Use Node.js ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: '20.x' | ||
# registry-url: 'https://registry.npmjs.org' | ||
# - name: Publish to npm | ||
# run: | | ||
# npm install | ||
# npm publish --access public | ||
# env: | ||
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
# #kick |
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,38 @@ | ||
# TODO: ENABLE / UNCOMMENT WHEN NPM_TOKEN IS SET in secrets REPO | ||
# name: release | ||
|
||
# on: | ||
# push: | ||
# branches: ["master"] | ||
# tags-ignore: ['**'] | ||
|
||
# jobs: | ||
# tests: | ||
# uses: ./.github/workflows/tests.yml | ||
# tag-release: | ||
# runs-on: ubuntu-latest | ||
# needs: [tests] | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: # important, must be defined on checkout to kick publish (defining in setup/node doesn't work) | ||
# token: ${{ secrets.GH_TOKEN }} | ||
# - name: Use Node.js ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: '20.x' | ||
# # cache: "npm" # needs lockfile if enabled | ||
|
||
# - name: tag release | ||
# run: | | ||
# # ignore if commit message is chore(release): ... | ||
# if [[ $(git log -1 --pretty=%B) =~ ^chore\(release\):.* ]]; then | ||
# echo "Commit message starts with 'chore(release):', skipping release" | ||
# exit 0 | ||
# fi | ||
# git config --local user.email "[email protected]" | ||
# git config --local user.name "creadbot_github" | ||
# set -v | ||
# npm install | ||
# npx commit-and-tag-version | ||
# git push | ||
# git push --tags |
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,24 @@ | ||
name: tests | ||
|
||
on: | ||
workflow_call: | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
node-version: ['18.x', '20.x', '22.x'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
# cache: "npm" # needs lockfile if enabled | ||
|
||
- run: npm install | ||
- run: npm run lint | ||
- run: npm test |