Skip to content

Commit 1ca397a

Browse files
WIP release upload
1 parent 2b939c3 commit 1ca397a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/build.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Build
33
on:
44
workflow_dispatch:
55
inputs:
6+
release-tag:
7+
description: Release to upload artefacts to (optional).
8+
type: string
69
build-deb-x64:
710
description: 'Build Linux .deb for x86_64'
811
type: boolean
@@ -33,6 +36,17 @@ jobs:
3336
uses: actions/checkout@v5
3437
with:
3538
persist-credentials: false
39+
- name: Validate release tag
40+
if: ${{ inputs.release-tag }}
41+
env:
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
RELEASE_TAG: ${{ inputs.release-tag }}
44+
run: |
45+
if ! gh release view "${RELEASE_TAG}" &> /dev/null;
46+
then
47+
echo "Release ${RELEASE_TAG} does not exist"
48+
exit 1
49+
fi
3650
- name: Setup JDK
3751
uses: actions/setup-java@v5
3852
with:
@@ -73,12 +87,22 @@ jobs:
7387
DPKG_DEB_COMPRESSOR_TYPE: xz
7488
run: java Exec.java build linux x64 deb
7589
- name: Upload
90+
if: ${{ ! inputs.release-tag }}
7691
uses: actions/upload-artifact@v5
7792
with:
7893
name: linux-deb-x64
7994
path: |
8095
dist/*.deb
8196
dist/*.deb.sha*
97+
- name: Upload to release
98+
if: ${{ inputs.release-tag }}
99+
env:
100+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
RELEASE_TAG: ${{ inputs.release-tag }}
102+
working-directory: ./dist
103+
run: |
104+
cat *.deb.sha*
105+
gh release upload "${RELEASE_TAG}" *.deb
82106
83107
build-deb-arm:
84108
name: Build Linux .deb for aarch64

0 commit comments

Comments
 (0)