-
Notifications
You must be signed in to change notification settings - Fork 63
79 lines (66 loc) · 2.27 KB
/
grapevine.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Grapevine Tagging
on:
push:
tags:
- 'v*.*.*-grape'
jobs:
create-grape:
name: Make a new grape
runs-on: ubuntu-latest
outputs:
VERSION_NO_GRAPE: "${{ steps.vars.outputs.VERSION_NO_GRAPE }}"
steps:
- uses: actions/checkout@v3
with:
token: ${{ github.token }}
- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# make some environment variables available for all steps
- name: Define variables
id: vars
run: |
version_num="${{ github.ref_name }}"
echo "VERSION_RAW=$version_num" >> "$GITHUB_ENV"
# strip the trailing "-grape"
version_no_grape=${version_num%-grape}
echo "VERSION_NO_GRAPE=$version_no_grape" >> "$GITHUB_ENV"
echo "VERSION_NO_GRAPE=$version_no_grape" >> "$GITHUB_OUTPUT"
# strip the leading v
version_plain=${version_no_grape#v}
echo "VERSION_PLAIN=$version_plain" >> "$GITHUB_ENV"
- name: Fill placeholders
run: |
bin/fill_placeholders "$VERSION_PLAIN"
- name: Generate Changelog
run: |
echo "Generating changelog (TODO)"
- name: Commit and tag grape
run: |
# get into a detached HEAD state by checking out the latest commit
# directly
git checkout $(git rev-parse HEAD)
git config --global user.name "James Johnson"
git config --global user.email "[email protected]"
git commit -am "Commit for $VERSION_NO_GRAPE"
git tag "$VERSION_NO_GRAPE"
git push --tags
- name: Delete grape tag
run: |
git push --delete origin "$VERSION_RAW"
- name: run other workflow
run: |
ls -la .github/workflows/
run_main_version_workflow:
needs: create-grape
# directly trigger the "new_release" workflow
uses: ./.github/workflows/new_release.yml
secrets: inherit
with:
ref: "${{ needs.create-grape.outputs.VERSION_NO_GRAPE }}"
ref_name: "${{ needs.create-grape.outputs.VERSION_NO_GRAPE }}"