Fix build
This commit is contained in:
36
.github/workflows/build.yml
vendored
36
.github/workflows/build.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Build and Release with xgo
|
||||
name: Build and Release
|
||||
|
||||
on: push
|
||||
|
||||
@@ -20,8 +20,8 @@ jobs:
|
||||
with:
|
||||
xgo_version: latest
|
||||
go_version: 1.21
|
||||
dest: build
|
||||
prefix: myapp
|
||||
dest: artifacts
|
||||
prefix: zurg
|
||||
targets: windows/amd64,linux/amd64,linux/arm64,darwin/arm64
|
||||
v: true
|
||||
x: false
|
||||
@@ -30,21 +30,18 @@ jobs:
|
||||
buildmode: default
|
||||
trimpath: true
|
||||
|
||||
- name: Prepare artifacts
|
||||
run: |
|
||||
mkdir artifacts
|
||||
mv github.com/debridmediamanager.com/zurg/cmd/zurg-* artifacts/
|
||||
|
||||
# New step for compressing artifacts
|
||||
- name: Compress artifacts
|
||||
run: |
|
||||
tar -czvf artifacts.tar.gz -C artifacts .
|
||||
mkdir -p compressed_artifacts
|
||||
for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do
|
||||
tar -czvf "compressed_artifacts/zurg-$platform-${{ github.run_number }}-${{ github.sha }}.tar.gz" -C artifacts ./zurg-$platform*
|
||||
done
|
||||
|
||||
- name: Upload artifacts to workflow
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: compiled-binaries
|
||||
path: artifacts.tar.gz
|
||||
path: compressed_artifacts/*.tar.gz
|
||||
|
||||
release:
|
||||
needs: build
|
||||
@@ -66,13 +63,16 @@ jobs:
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
# Ensure the asset_path matches the compressed file name
|
||||
- name: Upload binaries to release
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./artifacts.tar.gz
|
||||
asset_name: zurg-${{ github.run_number }}-${{ github.sha }}.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
run: |
|
||||
for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do
|
||||
asset_path="./compressed_artifacts/zurg-$platform-${{ github.run_number }}-${{ github.sha }}.tar.gz"
|
||||
if [[ -f "$asset_path" ]]; then
|
||||
echo "Uploading $asset_path"
|
||||
gh release upload ${{ github.ref }} "$asset_path" --c ${{ secrets.GITHUB_TOKEN }}
|
||||
else
|
||||
echo "File not found: $asset_path"
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user