forked from twohoursonelife/OneLife
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.86 KB
/
release.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
55
56
57
name: Release
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # Enables tag push to OneLife
env:
tag_prefix: 2HOL_v
steps:
- name: Setup auth for OneLifeData7
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GHA_AUTH_APP_ID }}
private-key: ${{ secrets.GHA_AUTH_PRIVATE_KEY }}
repositories: OneLifeData7 # Enables commit and tag push to OneLifeData7
- name: Checkout OneLife
uses: actions/checkout@v4
with:
repository: twohoursonelife/OneLife
path: OneLife
- name: Checkout OneLifeData7
uses: actions/checkout@v4
with:
repository: twohoursonelife/OneLifeData7
path: OneLifeData7
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Calculate next version
run: |
cd OneLifeData7
old_version=$(git describe --tags --abbrev=0 --match="2HOL_v[0-9]*" | sed -e "s/2HOL_v//")
echo "new_version=$(($old_version + 1))" >> $GITHUB_ENV
echo -n "$new_version" > dataVersionNumber.txt
- name: Commit and tag version - OneLifeData7
uses: EndBug/add-and-commit@v9
with:
cwd: OneLifeData7/
default_author: github_actions
message: Updatated dataVersionNumber to ${{ env.new_version }}
tag: ${{ env.tag_prefix }}${{ env.new_version }} -m "Tag automatically generated by GHA update script."
- name: Tag version - OneLife
run: |
cd OneLife
git config user.name "github-actions"
git config user.email "[email protected]"
git tag ${{ env.tag_prefix }}${{ env.new_version }} -m "Tag automatically generated by GHA update script."
git push origin --tags