Newer
Older
name: Create GitHub Release after tag push
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
# GET LATEST CODE
- name: Checkout latest code
uses: actions/checkout@master
with:
fetch-depth: 0
# EXTRACT TAG FROM PUSH
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Use tag
run: echo ${{steps.tag.outputs.tag}}
# GENERATE CHANGELOG, RELEASE
- id: conventional_changelog
uses: ardalanamini/auto-changelog@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.tag.outputs.tag }}
Automatic release of version: **${{ steps.tag.outputs.tag }}**
**Changes in this release:**
${{ steps.conventional_changelog.outputs.changelog }}
draft: false
prerelease: false
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# IF JAVA PROJECT
# # BUILD PROJECT AND PUBLISH TO PACKAGES
# - name: Set up JDK 8
# uses: actions/setup-java@v2
# with:
# distribution: 'adopt'
# java-version: '8'
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
# - name: Publish to GitHub Packages
# env:
# GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# NEW_VERSION=$(echo "${{ steps.tag.outputs.tag }}")
# echo "New version: ${NEW_VERSION}"
# echo "Github username: ${GITHUB_ACTOR}"
# ./gradlew about
# ./gradlew installQuasar cleanFrontend assembleFrontend copyDist build --info -x test
# - name: List files
# run: ls -ahl build/libs
#
# - name: Rename files
# run: |
# echo "**** Renaming files to please the eye ****"
# mv build/libs/REPOSITORY.jar build/libs/REPOSITORY-${{ steps.tag.outputs.tag }}.jar
# mv build/libs/REPOSITORY-javadoc.jar build/libs/REPOSITORY-${{ steps.tag.outputs.tag }}-javadoc.jar
# mv build/libs/REPOSITORY-sources.jar build/libs/REPOSITORY-${{ steps.tag.outputs.tag }}-sources.jar
#
# # UPLOAD ASSETS TO RELEASE
# - name: Upload Release Asset Main Jar
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./build/libs/REPOSITORY-${{ steps.tag.outputs.tag }}.jar
# asset_name: REPOSITORY-${{ steps.tag.outputs.tag }}.jar
# asset_content_type: application/jar
#
# - name: Upload Release Asset Sources Jar
# id: upload-release-asset-sources
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./build/libs/REPOSITORY-${{ steps.tag.outputs.tag }}-sources.jar
# asset_name: REPOSITORY-${{ steps.tag.outputs.tag }}-sources.jar
# asset_content_type: application/jar
#
# - name: Upload Release Asset Javadoc Jar
# id: upload-release-asset-javadoc
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./build/libs/REPOSITORY-${{ steps.tag.outputs.tag }}-javadoc.jar
# asset_name: REPOSITORY-${{ steps.tag.outputs.tag }}-javadoc.jar
# asset_content_type: application/jar
#
# # DOCKER RELATED
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: griefed
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./Dockerfile.gradle.quasar
# platforms: linux/amd64,linux/arm64
# push: true
# tags: |
# ghcr.io/griefed/REPOSITORY:latest
# ghcr.io/griefed/REPOSITORY:${{ steps.tag.outputs.tag }}
# griefed/REPOSITORY:latest
# griefed/REPOSITORY:${{ steps.tag.outputs.tag }}
# IF QUASAR PROJECT
# - name: Setup Node.js environment
# uses: actions/setup-node@v2.4.1
# with:
# # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
# node-version: '>= 16.9.1'
# # Set this option if you want the action to check for the latest available version that satisfies the version spec
# check-latest: false
#
# - name: Install Quasar
# run: npm install -g @quasar/cli
#
# - name: Install packages
# run: npm install
#
# - name: Build project for NGINX release package
# run: quasar build
#
# - name: List files
# run: pwd && ls -al *
#
# # NGINX Archives
# - name: Create NGINX Archive tar.gz
# run: |
# echo "**** Creating archive of quasar build ****"
# tar -cvzf REPOSITORY-NGINX-${{ steps.tag.outputs.tag }}.tar.gz dist/spa
# - name: Create NGINX Archive zip
# uses: papeloto/action-zip@v1
# with:
# files: dist/spa
# recursive: true
# dest: REPOSITORY-NGINX-${{ steps.tag.outputs.tag }}.zip
#
# # Upload NGINX Assets
# - name: Upload Release Archive tar.gz
# id: upload-release-asset-archive-targz
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./REPOSITORY-NGINX-${{ steps.tag.outputs.tag }}.tar.gz
# asset_name: REPOSITORY-NGINX-${{ steps.tag.outputs.tag }}.tar.gz
# asset_content_type: application/gzip
# - name: Upload Release Archive zip
# id: upload-release-asset-archive-zip
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./REPOSITORY-NGINX-${{ steps.tag.outputs.tag }}.zip
# asset_name: REPOSITORY-NGINX-${{ steps.tag.outputs.tag }}.zip
# asset_content_type: application/zip
#
# # DEPLOY TO GH-PAGES
# - name: Deploy to GitHub-Pages
# uses: JamesIves/github-pages-deploy-action@4.1.6
# with:
# branch: gh-pages
# folder: dist/spa
# # DOCKER RELATED
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: griefed
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./Dockerfile.gradle.quasar
# platforms: linux/amd64,linux/arm64
# push: true
# tags: |
# ghcr.io/griefed/REPOSITORY:latest
# ghcr.io/griefed/REPOSITORY:${{ steps.tag.outputs.tag }}
# griefed/REPOSITORY:latest
# griefed/REPOSITORY:${{ steps.tag.outputs.tag }}
# IF ELECTRON PROJECT
# electron:
# needs: release
# runs-on: ${{ matrix.os }}
#
# strategy:
# matrix:
# os: [macos-latest, ubuntu-latest, windows-latest]
#
# steps:
# # GET LATEST CODE
# - name: Checkout latest code
# uses: actions/checkout@master
# with:
# fetch-depth: 0
#
# # SETUP NODE ENVIRONMENT
# - name: Setup Node.js environment
# uses: actions/setup-node@v2.4.1
# with:
# # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
# node-version: '>= 16.9.1'
# # Set this option if you want the action to check for the latest available version that satisfies the version spec
# check-latest: false
#
# - name: Build/release Electron app
# uses: vedaprakashms/quasar_electron_build@V0.0.1
# with:
# # GitHub token, automatically provided to the action
# # (No need to define this secret in the repo settings)
# github_token: ${{ secrets.github_token }}
#
# - name: List files
# run: ls dist/electron
#
# - name: Rename folders
# run: |
# mv dist/electron/REPOSITORY* REPOSITORY-${{ matrix.os }}
#
# # Electron Archives
# - name: Create zip
# uses: ihiroky/archive-action@v1
# with:
# root_dir: REPOSITORY-${{ matrix.os }}
# file_path: REPOSITORY-${{ matrix.os }}-${{ needs.release.outputs.newtag }}.zip
# verbose: true
# - name: Create tar.gz
# run: |
# tar -cvzf REPOSITORY-app-${{ matrix.os }}-${{ needs.release.outputs.newtag }}.tar.gz REPOSITORY-${{ matrix.os }}
#
# # Upload App Assets
# - name: Upload App Archive zip
# id: upload-release-asset-archive-zip
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.release.outputs.uploadurl }}
# asset_path: ./REPOSITORY-app-${{ matrix.os }}-${{ needs.release.outputs.newtag }}.zip
# asset_name: REPOSITORY-app-${{ matrix.os }}-${{ needs.release.outputs.newtag }}.zip
# asset_content_type: application/zip
# - name: Upload App Archive tar.gz
# id: upload-release-asset-archive-targz
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.release.outputs.uploadurl }}
# asset_path: ./REPOSITORY-app-${{ matrix.os }}-${{ needs.release.outputs.newtag }}.tar.gz
# asset_name: REPOSITORY-app-${{ matrix.os }}-${{ needs.release.outputs.newtag }}.tar.gz
# asset_content_type: application/gzip