-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.99 KB
/
distribute.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
name: Distribute
on:
push:
branches: [develop, beta, main]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Version
run: echo VERSION=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV
- name: Set Variant (Develop)
if: github.ref == 'refs/heads/develop'
run: echo VARIANT=dev >> $GITHUB_ENV
- name: Set Variant (Beta)
if: github.ref == 'refs/heads/beta'
run: echo VARIANT=beta >> $GITHUB_ENV
- name: Next Build Number Action
uses: ./
id: next_build_number
with:
format: '${{ env.VERSION }}-${{ env.VARIANT }}(\d+)'
- name: Create Release (Develop)
id: create_release_develop
if: github.ref == 'refs/heads/develop'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}-${{ env.VARIANT }}${{ steps.next_build_number.outputs.next }}
release_name: ${{ env.VERSION }}-${{ env.VARIANT }}${{ steps.next_build_number.outputs.next }}
draft: false
prerelease: true
- name: Create Release (Beta)
id: create_release_beta
if: github.ref == 'refs/heads/beta'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}-${{ env.VARIANT }}${{ steps.next_build_number.outputs.next }}
release_name: ${{ env.VERSION }}-${{ env.VARIANT }}${{ steps.next_build_number.outputs.next }}
draft: false
prerelease: true
- name: Create Release (Main)
id: create_release_main
if: github.ref == 'refs/heads/main'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: false