Skip to content

Commit 1cd8c02

Browse files
committed
fix: release workflow not uploading binary assets (fixes #56)
Root cause: softprops/action-gh-release@v2 silently failed when the release already existed (created by release-please via GITHUB_TOKEN). Changes: - Replace softprops/action-gh-release with gh release upload --clobber - Add aarch64-unknown-linux-gnu (Linux ARM64) to build matrix - Add cross-compilation setup for ARM64 (gcc-aarch64-linux-gnu + ALSA) - Add error logging for tag resolution and artifact listing
1 parent c89c7bc commit 1cd8c02

1 file changed

Lines changed: 47 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242
features: ""
4343
archive: tar.gz
4444
deps: libasound2-dev
45+
- target: aarch64-unknown-linux-gnu
46+
os: ubuntu-latest
47+
features: ""
48+
archive: tar.gz
49+
cross: true
50+
deps: gcc-aarch64-linux-gnu libc6-dev-arm64-cross
4551
- target: x86_64-pc-windows-msvc
4652
os: windows-latest
4753
features: ""
@@ -58,10 +64,36 @@ jobs:
5864

5965
- name: Install system deps (Linux)
6066
if: matrix.deps != ''
61-
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.deps }}
67+
run: |
68+
sudo dpkg --add-architecture arm64 || true
69+
sudo apt-get update
70+
sudo apt-get install -y ${{ matrix.deps }}
71+
72+
- name: Install ALSA cross-compile deps (Linux ARM64)
73+
if: matrix.cross == true
74+
run: |
75+
# Add arm64 architecture and install cross-compile ALSA
76+
sudo dpkg --add-architecture arm64
77+
# Add arm64 package sources
78+
sudo sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list.d/*.list || true
79+
echo "deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs) main restricted universe" | sudo tee /etc/apt/sources.list.d/arm64.list
80+
echo "deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-updates main restricted universe" | sudo tee -a /etc/apt/sources.list.d/arm64.list
81+
sudo apt-get update
82+
sudo apt-get install -y libasound2-dev:arm64
83+
env:
84+
PKG_CONFIG_ALLOW_CROSS: 1
85+
86+
- name: Build (native)
87+
if: matrix.cross != true
88+
run: cargo build --release --target ${{ matrix.target }} ${{ matrix.features != '' && format('--features {0}', matrix.features) || '' }}
6289

63-
- name: Build
90+
- name: Build (cross)
91+
if: matrix.cross == true
6492
run: cargo build --release --target ${{ matrix.target }} ${{ matrix.features != '' && format('--features {0}', matrix.features) || '' }}
93+
env:
94+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
95+
PKG_CONFIG_ALLOW_CROSS: 1
96+
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
6597

6698
- name: Package (tar.gz)
6799
if: matrix.archive == 'tar.gz'
@@ -85,44 +117,46 @@ jobs:
85117
path: vox-${{ matrix.target }}.${{ matrix.archive }}
86118

87119
release:
88-
name: Create Release
120+
name: Upload Release Assets
89121
needs: [build]
90122
runs-on: ubuntu-latest
91123
steps:
92-
- name: Checkout
93-
uses: actions/checkout@v4
94-
95124
- name: Download all artifacts
96125
uses: actions/download-artifact@v4
97126
with:
98127
path: artifacts
99128

100-
- name: Get version
129+
- name: Get tag
101130
id: version
102131
run: |
103132
TAG="${{ inputs.tag }}"
104133
if [ -z "$TAG" ]; then
105134
TAG="${{ github.event.release.tag_name }}"
106135
fi
107-
echo "version=$TAG" >> $GITHUB_OUTPUT
136+
if [ -z "$TAG" ]; then
137+
echo "::error::No tag found"
138+
exit 1
139+
fi
140+
echo "tag=$TAG" >> $GITHUB_OUTPUT
108141
109142
- name: Flatten artifacts
110143
run: |
111144
mkdir -p release
112145
find artifacts -type f \( -name "*.tar.gz" -o -name "*.zip" \) -exec cp {} release/ \;
146+
echo "=== Release assets ==="
147+
ls -lh release/
113148
114149
- name: Create checksums
115150
run: |
116151
cd release
117152
sha256sum * > checksums.txt
153+
cat checksums.txt
118154
119-
- name: Upload Release Assets
120-
uses: softprops/action-gh-release@v2
121-
with:
122-
tag_name: ${{ steps.version.outputs.version }}
123-
files: release/*
155+
- name: Upload to existing release
156+
run: gh release upload "$TAG" release/* --clobber --repo "${{ github.repository }}"
124157
env:
125158
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159+
TAG: ${{ steps.version.outputs.tag }}
126160

127161
homebrew:
128162
name: Update Homebrew formula

0 commit comments

Comments
 (0)