generated from MechanicalFlower/godot-template
-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (68 loc) · 2.2 KB
/
publish.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
80
81
name: Publish
# Only trigger, when the build workflow succeeded
on:
workflow_run:
workflows: ["Build"]
types: [completed]
env:
tag_name: ${{ github.event.workflow_run.head_branch }}
jobs:
create_release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-22.04
name: Create Release
steps:
- name: Check Tag
run: |
if [[ ! ${{ env.tag_name }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
exit 1
fi
- name: Create Draft release
run: |
gh release create "${{ env.tag_name }}" \
--repo="${{ github.repository }}" \
--title="v${{ env.tag_name }}" \
--draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs: create_release
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- platform: windows
preset: Windows Desktop
- platform: linux
preset: Linux/X11
# - platform: web
# preset: Web
- platform: mac
preset: macOS
name: ${{ matrix.preset }} Publish
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: Marble-${{ matrix.platform }}-v${{ env.tag_name }}
path: dist/${{ matrix.platform }}
skip_unpack: true
- name: Upload to release
run: |
gh release upload "${{ env.tag_name }}" \
--repo="${{ github.repository }}" \
--clobber \
dist/${{ matrix.platform }}/Marble-${{ matrix.platform }}-v${{ env.tag_name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to itch.io
uses: josephbmanley/[email protected]
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_API_KEY }}
CHANNEL: ${{ matrix.platform }}
ITCH_GAME: Marble
ITCH_USER: mechanical-flower
PACKAGE: dist/${{ matrix.platform }}/Marble-${{ matrix.platform }}-v${{ env.tag_name }}.zip
VERSION: ${{ env.tag_name }}