-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.59 KB
/
ci-main.yml
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
name: CI Main
on:
push:
branches: ["main"]
paths:
- "src/*"
- "package.json"
- ".github/workflows/ci-main.*"
jobs:
create-release-draft:
name: Create Release Draft
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: https://registry.npmjs.org/
- name: Check package versions
id: check_versions
run: |
PUBLISHED_VERSION=`npm show @treasure-chess/chess-image-generator version`
NEW_VERSION=`jq -r .version package.json`
if [ "$PUBLISHED_VERSION" != "$NEW_VERSION" ];then
echo "SHOULD_PUBLISH=1" >> $GITHUB_ENV
echo "version changed: $PUBLISHED_VERSION -> $NEW_VERSION"
else
echo version unchanged: $PUBLISHED_VERSION
fi
echo "::set-output name=NEW_VERSION::$NEW_VERSION"
- name: Create release draft
if: env.SHOULD_PUBLISH == 1
id: create_release
uses: actions/create-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: chess-image-generator@v${{ steps.check_versions.outputs.NEW_VERSION }}
release_name: chess-image-generator@v${{ steps.check_versions.outputs.NEW_VERSION }}
body: |
Changes in this Release
## Changed
## Added
## Fixes
## Breaking
draft: true