Skip to content

Commit dc3db19

Browse files
committed
gha: Add workflow_dispatch to binary-release and fix stale directory removal bug
1 parent 3464a9c commit dc3db19

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/binary-release.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
tags:
66
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to build (e.g. v12.0.0)'
11+
required: true
12+
type: string
713

814
jobs:
915
build:
@@ -25,12 +31,19 @@ jobs:
2531

2632
- name: Checkout code
2733
uses: actions/checkout@v6
34+
with:
35+
ref: ${{ inputs.tag || github.ref }}
2836

2937
- name: Git config
3038
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
3139

3240
- name: Get tag name
33-
run: echo "TAG_NAME=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))" >> $GITHUB_ENV
41+
run: |
42+
if [ -n "${{ inputs.tag }}" ]; then
43+
echo "TAG_NAME=${{ inputs.tag }}" >> $GITHUB_ENV
44+
else
45+
echo "TAG_NAME=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))" >> $GITHUB_ENV
46+
fi
3447
3548
- name: Regenerate
3649
run: ./bootstrap
@@ -49,14 +62,12 @@ jobs:
4962

5063
- name: Fetch MinGW
5164
run: |
52-
set -e
5365
curl -Lo /tmp/mingw-i486.tar.xz https://github.com/osdev0/mingw-binary-builds/releases/latest/download/mingw-i486.tar.xz
5466
cd /tmp
5567
tar -xf mingw-i486.tar.xz
5668
5769
- name: Build limine for Windows
5870
run: |
59-
set -e
6071
make -C build/bin CC="/tmp/mingw-i486/bin/i486-w64-mingw32-gcc" CFLAGS="-O2 -pipe" CPPFLAGS="-D__USE_MINGW_ANSI_STDIO" limine
6172
/tmp/mingw-i486/bin/i486-w64-mingw32-strip build/bin/limine.exe
6273
mkdir build/bin/limine-tool-windows-x86
@@ -70,25 +81,24 @@ jobs:
7081

7182
- name: Create binary release zip and tarballs
7283
run: |
73-
set -e
7484
TARBALL_DIRNAME=$(echo ${TAG_NAME} | sed 's/^v//g')
7585
mv build/bin ./limine-binary-${TARBALL_DIRNAME}
7686
zip -r limine-binary-${TARBALL_DIRNAME}.zip limine-binary-${TARBALL_DIRNAME}
7787
tar -cvf limine-binary-${TARBALL_DIRNAME}.tar limine-binary-${TARBALL_DIRNAME}
7888
gzip < limine-binary-${TARBALL_DIRNAME}.tar > limine-binary-${TARBALL_DIRNAME}.tar.gz
7989
xz < limine-binary-${TARBALL_DIRNAME}.tar > limine-binary-${TARBALL_DIRNAME}.tar.xz
80-
rm limine-binary-${TARBALL_DIRNAME}.tar
90+
rm -rf limine-binary-${TARBALL_DIRNAME}.tar limine-binary-${TARBALL_DIRNAME}
8191
8292
- name: Sign release tarball
8393
run: |
84-
set -e
85-
for f in limine-binary-*.*; do \
86-
gpg --batch --default-key 05D29860D0A0668AAEFB9D691F3C021BECA23821 --detach-sign $f; \
94+
for f in limine-binary-*.*; do
95+
gpg --batch --default-key 05D29860D0A0668AAEFB9D691F3C021BECA23821 --detach-sign $f
8796
done
8897
8998
- name: Add binary tarball to the release
9099
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
91100
with:
101+
tag_name: ${{ env.TAG_NAME }}
92102
files: |
93103
limine-binary-*.*
94104
env:

0 commit comments

Comments
 (0)