-
-
Notifications
You must be signed in to change notification settings - Fork 74
73 lines (65 loc) · 2.11 KB
/
create-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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Create Release
on:
workflow_dispatch:
inputs:
release-type:
type: choice
options:
- minor_beta
- major_beta
- patch
- minor
- major
required: true
jobs:
get-version:
name: "Get Version"
runs-on: ubuntu-latest
outputs:
version: ${{ steps.fetch_version.outputs.version }}
is-beta: ${{ steps.fetch_version.outputs.is-beta }}
branch: ${{ steps.set_branch.outputs.result }}
steps:
- name: Fetch Version From API
uses: Macro-Deck-App/Actions/fetch-version@main
id: fetch_version
with:
release-type: ${{ inputs.release-type }}
- name: Set branch name
id: set_branch
run: |
if [[ "${{ steps.fetch_version.outputs.is-beta }}" == "true" ]]; then
echo "::set-output name=result::develop"
else
echo "::set-output name=result::main"
fi
bump-version:
name: "Bump Version"
runs-on: ubuntu-latest
needs: [get-version]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ needs.get-version.outputs.branch }}
- name: Update CSProj Version
run: |
sed -i 's/<Version>.*<\/Version>/<Version>${{ needs.get-version.outputs.version }}<\/Version>/' ./MacroDeck/MacroDeck.csproj
git add ./MacroDeck/MacroDeck.csproj
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Bump Version to ${{ needs.get-version.outputs.version }}
release-github:
name: "Release GitHub"
runs-on: ubuntu-latest
needs: [get-version, bump-version]
steps:
- name: "Create Release"
uses: Macro-Deck-App/Actions/create-github-release@main
id: create_release
with:
github-token: "${{ secrets.PAT }}"
is-beta: ${{ needs.get-version.outputs.is-beta }}
version: ${{ needs.get-version.outputs.version }}
target-commitish: ${{ needs.get-version.outputs.branch }}