Skip to content

Commit

Permalink
Update actions and release method
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfeil committed Jan 4, 2023
1 parent 7996395 commit 30f891f
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 47 deletions.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Release notes for `lanuv-parser` are generated automatically, based on pull request titles and labels. Please provide a nice title and select the right labels for this PR. Thank you!

Relevant labels are:

- Introduction of a new feature:
- `feature`
- Bugfix:
- `fix`
- Maintenance:
- `chore`

PRs with any of these labels will be excluded from the release notes:

- `dependencies` - Updating dependencies
- `refactor` - Improving the implementation of a specific part of the codebase, without changing its functionality
30 changes: 30 additions & 0 deletions .github/release-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name-template: "v$RESOLVED_VERSION 🏳️‍🌈"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: 🚀 Features
label: feature

- title: 🐛 Bug Fixes
labels: fix

- title: 🧰 Maintenance
label: chore
exclude-labels:
- "dependencies"
- "refactor"
version-resolver:
major:
labels:
- "feature"
minor:
labels:
- "fix"
patch:
labels:
- "chore"
default: patch
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
template: |
## Changes
$CHANGES
70 changes: 23 additions & 47 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,38 @@
name: Create release & publish on npm
name: Build lanuv parser package and publish

on:
push:
tags:
- 'v*'
release:
branches:
- main
types: [released]

jobs:
build:

test:
name: Test package
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

node-version: [16.x]
steps:
- name: Checkout code
uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: yarn install and test
run: |
yarn install
yarn test
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build --if-present
- run: npm test
env:
CI: true

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Create Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: Archive language files
uses: actions/upload-artifact@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: yarn install and test
name: lanuv-parser
path: dist
- name: Release new version
run: |
yarn install
npm publish
npm version ${{ github.event.release.tag_name }} --no-git-tag-version --no-commit-hooks
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Notes Creator
on:
push:
branches:
- main
jobs:
create-release-notes:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-template.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 30f891f

Please sign in to comment.