Skip to content

Commit f7149c5

Browse files
author
Claudio Luck
committed
Publish action, again
1 parent 79c8111 commit f7149c5

2 files changed

Lines changed: 34 additions & 19 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
name: Build
1+
name: build
22

33
on:
4+
release:
5+
# types: [published]
46
push:
57
branches:
68
- master
@@ -41,9 +43,9 @@ jobs:
4143

4244
- name: Install MinGW
4345
run: |
44-
sudo apt-get update
45-
sudo apt-get install -y --no-install-recommends g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64
46-
sudo apt-get install -y --no-install-recommends g++-mingw-w64-i686 binutils-mingw-w64-i686
46+
sudo apt-get install -y --no-install-recommends \
47+
g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 \
48+
g++-mingw-w64-i686 binutils-mingw-w64-i686
4749
4850
- name: Checkout source
4951
uses: actions/checkout@v6

.github/workflows/release.yaml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: Release
1+
name: release
22

33
on:
4-
release:
5-
types: [published]
64
workflow_run:
7-
workflows: [Build]
5+
workflows: ["build"]
86
types:
97
- completed
108

@@ -13,24 +11,39 @@ permissions:
1311
contents: write
1412

1513
jobs:
16-
release:
14+
15+
assets:
1716
runs-on: ubuntu-latest
17+
if: ${{ (github.event.workflow_run.conclusion == 'success') && (github.event.release.tag_name != '') }}
1818

1919
steps:
2020

21+
- name: Download artifacts
22+
uses: actions/download-artifact@v6
23+
with:
24+
pattern: binaries-*
25+
path: artifacts/
26+
# run-id: ${{ github.event.workflow_run.id }}
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
2129
- name: '📦 Publish packages'
30+
# if: ${{ startsWith(github.event.release.tag_name, 'rel-') }}
2231
run: |
2332
cd ${{github.workspace}}
24-
env -C build/linux zip -r ../ubuntu-amd64.zip bin/ man/
25-
env -C build/linux/static zip -r ../../linux-static-amd64.zip bin/ man/
26-
env -C build/macos zip -r ../macos-arm64.zip bin/ man/
27-
env -C build/win/x64 zip -r ../../win32-x86_64.zip bin/
28-
env -C build/win/x86 zip -r ../../win32-x86.zip bin/
29-
gh release upload ${{github.event.release.tag_name}} build/ubuntu-amd64.zip
30-
gh release upload ${{github.event.release.tag_name}} build/linux-static-amd64.zip
31-
gh release upload ${{github.event.release.tag_name}} build/macos-arm64.zip
32-
gh release upload ${{github.event.release.tag_name}} build/win32-x86_64.zip
33-
gh release upload ${{github.event.release.tag_name}} build/win32-x86.zip
33+
mkdir -p build
34+
find artifacts/ build/ -ls
35+
env -C artifacts/binaries-linux-x64 zip -r ../../build/ubuntu-amd64.zip bin/ man/
36+
env -C artifacts/binaries-macos zip -r ../../build/macos-arm64.zip bin/ man/
37+
env -C artifacts/binaries-linux-x64 zip -r ../../build/linux-static-amd64.zip bin/ man/
38+
env -C artifacts/binaries-win-x64 zip -r ../../build/win32-x64.zip bin/
39+
env -C artifacts/binaries-win-x86 zip -r ../../build/win32-x86.zip bin/
40+
#[ -n "${{github.event.release.tag_name}}" ] && refname="${{github.event.release.tag_name}}" || refname="${{github.ref_name}}"
41+
refname="${{github.event.release.tag_name}}"
42+
gh release upload "$refname" build/ubuntu-amd64.zip
43+
gh release upload "$refname" build/linux-static-amd64.zip
44+
gh release upload "$refname" build/macos-arm64.zip
45+
gh release upload "$refname" build/win32-x64.zip
46+
gh release upload "$refname" build/win32-x86.zip
3447
env:
3548
GITHUB_TOKEN: ${{ github.TOKEN }}
3649
shell: bash

0 commit comments

Comments
 (0)