-
Notifications
You must be signed in to change notification settings - Fork 9
42 lines (38 loc) · 1.32 KB
/
semanticVersionUpdater.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
name: Semantic Version Updater
on:
pull_request:
types: [closed]
branches:
- 'main'
jobs:
semantic-version-update:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Set git configs
run: git config --global push.followTags true
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v1
with:
python-version: '3.8'
architecture: 'x64'
- name: Get version
run: echo "UPDATE_TYPE=$(python .github/workflows/semanticVersionUpdater/get-update-type.py "${{ github.event.pull_request.title }}")" >> $GITHUB_ENV
- name: Update version
run: echo "NEW_VERSION=$(python .github/workflows/semanticVersionUpdater/read-version.py forge/info.rkt $UPDATE_TYPE)" >> $GITHUB_ENV
- name: Commit files
run: |
git add .
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Bump version to v$NEW_VERSION" -a
git tag -a "v$NEW_VERSION" -m "${{ github.event.pull_request.title }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}