-
Notifications
You must be signed in to change notification settings - Fork 62
168 lines (147 loc) · 9.88 KB
/
Deploy.yml
File metadata and controls
168 lines (147 loc) · 9.88 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Deploy
on:
workflow_dispatch:
workflow_call:
jobs:
Deploy-Project:
name: Deploy Releases to Github Release
runs-on: ubuntu-latest
steps:
# ------------------------------------------------------------------------------------------------------
# Createin version Tag & Number variables
# ------------------------------------------------------------------------------------------------------
- name: Create Version Environment Variable
id: set_version
if: ${{github.workflow == 'CD'}}
run: |
if [[ ${{github.event.inputs.revision}} != 0 ]]; then
echo "Alpha Version"
echo "gingertag=20${{ github.event.inputs.major}}.${{ github.event.inputs.minor}}-Alpha.${{github.event.inputs.build}}.${{ github.event.inputs.revision}}" >> $GITHUB_ENV
elif [[ ${{github.event.inputs.build}} != 0 && ${{github.event.inputs.revision}} == 0 ]]; then
echo "Beta Version"
echo "gingertag=20${{ github.event.inputs.major}}.${{ github.event.inputs.minor}}-Beta.${{ github.event.inputs.build}}" >> $GITHUB_ENV
elif [[ ${{github.event.inputs.build}} == 0 && ${{github.event.inputs.revision}} == 0 ]]; then
echo "Official Version"
echo "gingertag=20${{ github.event.inputs.major}}.${{ github.event.inputs.minor}}-Official" >> $GITHUB_ENV
fi
echo "ginger gingertag ${{env.gingertag}}"
- name: Print Version Environment Variable
if: ${{github.workflow == 'CD'}}
run: |
echo "GingerNumber Version: ${{ env.gingernumber}}"
# ------------------------------------------------------------------------------------------------------
# Copy Ginger repo
# ------------------------------------------------------------------------------------------------------
- uses: actions/checkout@v5
# ------------------------------------------------------------------------------------------------------
# Download Windows Installer Artifact
# ------------------------------------------------------------------------------------------------------
- name: Download Windows Installer Artifact
uses: actions/download-artifact@v7
with:
name: WindowsInstaller
# ------------------------------------------------------------------------------------------------------
# Download GingerRuntime_Linux Artifact
# ------------------------------------------------------------------------------------------------------
- name: Restore GingerRuntime_Linux
uses: actions/cache@v5
with:
path: ./GingerRuntime_Linux-root.tar.gz
key: cache-GingerRuntime_Linux-${{ github.run_number }}
enableCrossOsArchive:
true
# ------------------------------------------------------------------------------------------------------
# Download GingerRuntime_MacOS Artifact
# ------------------------------------------------------------------------------------------------------
- name: Restore GingerRuntime_MacOS
uses: actions/cache@v5
with:
path: ./GingerRuntime_MacOS-root.tar.gz
key: cache-GingerRuntime_MacOS-${{ github.run_number }}
enableCrossOsArchive:
true
# ------------------------------------------------------------------------------------------------------
# Create new Release for ginger
# ------------------------------------------------------------------------------------------------------
- name: Create Github Release
id: create-new-release
uses: GongT/actions-recreate-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ env.gingertag}}
release_name: Ginger v${{ env.gingertag}}
draft: true
- name: Print File Content
run: |
ls
echo "==============================================="
# ------------------------------------------------------------------------------------------------------
# Upload GingerRuntime_Linux.tar.gz to Github Releases
# ------------------------------------------------------------------------------------------------------
- name: Upload Assest to Github Releases - GingerRuntime_Linux.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./GingerRuntime_Linux-root.tar.gz
asset_name: GingerRuntime_Linux.${{ env.gingertag}}.tar.gz
asset_content_type: application/gzip
# ------------------------------------------------------------------------------------------------------
# Upload GingerRuntime_MacOS.tar.gz to Github Releases
# ------------------------------------------------------------------------------------------------------
- name: Upload Assest to Github Releases - GingerRuntime_MacOS.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./GingerRuntime_MacOS-root.tar.gz
asset_name: GingerRuntime_MacOS.${{ env.gingertag}}.tar.gz
asset_content_type: application/gzip
# ------------------------------------------------------------------------------------------------------
# Upload Ginger.exe to Github Releases
# ------------------------------------------------------------------------------------------------------
- name: Upload Assest to Github Releases - Ginger.exe
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Ginger.exe
asset_name: Ginger.${{ env.gingertag}}.exe
asset_content_type: application/exe
# ------------------------------------------------------------------------------------------------------
# Upload Ginger Documents to Github Releases
# ------------------------------------------------------------------------------------------------------
- name: Upload Assest to Github Releases - Ginger.Release.Notes.pdf
if: ( !(contains(env.gingertag , 'Beta' )) && !(contains(env.gingertag , 'Alpha' )) )
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Documents/Ginger.Release.Notes.pdf
asset_name: Ginger.Release.Notes.pdf
asset_content_type: application/doc
- name: Upload Assest to Github Releases - Ginger.System.Requirements.pdf
if: ( !(contains(env.gingertag , 'Beta' )) && !(contains(env.gingertag , 'Alpha' )) )
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Documents/Ginger.System.Requirements.pdf
asset_name: Ginger.System.Requirements.pdf
asset_content_type: application/doc
- name: Upload Assest to Github Releases - GingerRuntime.System.Requirements.pdf
if: ( !(contains(env.gingertag , 'Beta' )) && !(contains(env.gingertag , 'Alpha' )) )
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Documents/GingerRuntime.System.Requirements.pdf
asset_name: GingerRuntime.System.Requirements.pdf
asset_content_type: application/doc