-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (53 loc) · 1.95 KB
/
pipeline.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
name: pipeline
on:
push:
branches:
- "develop"
- "release"
- "main"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set common env
run: |
echo "RELEASE_CHANGELOG=changes.md" >> $GITHUB_ENV
- name: Set alpha env
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
echo "RELEASE_PRE=true" >> $GITHUB_ENV
echo "RELEASE_SUFFIX=alpha" >> $GITHUB_ENV
echo "RELEASE_KIND=pre-release" >> $GITHUB_ENV
- name: Set beta env
if: ${{ github.ref == 'refs/heads/release' }}
run: |
echo "RELEASE_PRE=true" >> $GITHUB_ENV
echo "RELEASE_SUFFIX=beta" >> $GITHUB_ENV
echo "RELEASE_KIND=pre-release" >> $GITHUB_ENV
- name: Set release env
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo "RELEASE_PRE=false" >> $GITHUB_ENV
echo "RELEASE_SUFFIX=beta" >> $GITHUB_ENV
echo "RELEASE_KIND=release" >> $GITHUB_ENV
- name: Create TAG
id: tag
if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/release' || github.ref == 'refs/heads/main' }}
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
PRERELEASE: ${{ env.RELEASE_PRE }}
PRERELEASE_SUFFIX: ${{ env.RELEASE_SUFFIX }}
- name: Create release
if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/release' || github.ref == 'refs/heads/main' }}
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ env.RELEASE_PRE }}
body_path: ${{ github.workspace }}/${{ env.RELEASE_CHANGELOG }}
name: ${{ env.RELEASE_KIND }} ${{ steps.tag.outputs.new_tag }}
tag_name: ${{ steps.tag.outputs.new_tag }}