-
Notifications
You must be signed in to change notification settings - Fork 19
55 lines (53 loc) · 1.56 KB
/
prepare_release.yml
File metadata and controls
55 lines (53 loc) · 1.56 KB
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: prepare_release
on:
push:
branches:
- master
jobs:
check:
name: check release version
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.bumpr.outputs.skip }}
version: ${{ steps.bumpr.outputs.next_version }}
steps:
- uses: actions/checkout@v2
- id: bumpr
uses: haya14busa/action-bumpr@v1
with:
dry_run: true
prepare:
name: prepare release
needs: check
if: '!needs.check.outputs.skip'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: setup node
uses: actions/setup-node@v2
with:
node-version: '22'
- name: update changelog
run: |
export NEXT_VERSION_V=${{ needs.check.outputs.version }}
export NEXT_VERSION=${NEXT_VERSION_V:1}
sed -i "/\[Unreleased\]/a ## [$NEXT_VERSION] newDateHere" CHANGELOG.md
sed -i "s/newDateHere/$(date '+%Y-%m-%d')/g" CHANGELOG.md
- name: commit changelog
run: |
git config --global user.name 'CCDirectLink Bot'
git config --global user.email 'keanucode@c2dl.info'
git commit -am "prepare changelog for release (from GitHub Actions)"
- name: make version tag
working-directory: webapp
run: |
mkdir .git
npm version ${{ needs.check.outputs.version }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
tags: true
github_token: ${{ secrets.PAT }}