This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (61 loc) · 2.01 KB
/
Release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get version from input
id: tag_name
shell: bash
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
echo ::set-output name=current_version::${INPUT_VERSION}
- uses: pnpm/[email protected]
with:
version: 6.20.2
- name: Use Node.js 16.13.0
uses: actions/setup-node@v2
with:
node-version: 16.13.0
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run build
run: pnpm run build
- name: Run tests
run: pnpm run test
- name: Set version
run: npm version ${{ steps.tag_name.outputs.current_version }} --no-commit-hooks --no-git-tag-version --allow-same-version
- name: Pack
run: pnpm pack
- name: Publish
run: pnpm publish rpgmpacker-${{ steps.tag_name.outputs.current_version }}.tgz --no-git-checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ steps.changelog_reader.outputs.version }}
name: Release ${{ steps.changelog_reader.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
files: |
rpgmpacker-*.tgz