Skip to content

Commit

Permalink
chore: add gh actions
Browse files Browse the repository at this point in the history
There is no build step, but keep it for later reference.
  • Loading branch information
tkurki committed Feb 23, 2024
1 parent 9ac2a76 commit 68c31d2
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish to npm

# https://stackoverflow.com/questions/69063452/github-actions-on-release-created-workflow-trigger-not-working
on:
workflow_run:
workflows: ["Release on tag"]
types: [completed]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/release_on_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Release on tag'
on:
push:
tags:
- '*'

jobs:
release:
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - uses: actions/setup-node@v3
# with:
# node-version: '20.x'
# registry-url: 'https://registry.npmjs.org'
# - run: npm install && npm run build && npm pack

- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}

- name: Create Release
uses: ncipollo/release-action@v1
with:
body: ${{steps.github_release.outputs.changelog}}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}
13 changes: 13 additions & 0 deletions .github/workflows/require_pr_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Pull Request Labels
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
with:
mode: exactly
count: 1
labels: "fix, feature, doc, chore, test, ignore, other, dependencies"

0 comments on commit 68c31d2

Please sign in to comment.