Skip to content

Commit

Permalink
fix: release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
banditopazzo committed Oct 24, 2023
1 parent 92247b2 commit 589e35a
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
tags:
- '*'

env:
TAG: ${{ github.ref_name }}

jobs:
vendored_archive:
name: Vendored archive
Expand All @@ -13,10 +16,10 @@ jobs:
uses: actions/checkout@v4

- name: Create release directory
run: rsync -rv --exclude=.git . ../cosmo-${{ env.REGISTRY_TAG }}
run: rsync -rv --exclude=.git . ../cosmo-${{ env.TAG }}

- name: Cargo vendor
working-directory: ../cosmo-${{ env.REGISTRY_TAG }}
working-directory: ../cosmo-${{ env.TAG }}
run: |
mkdir ../vendor-cargo-home
export CARGO_HOME=$(realpath ../vendor-cargo-home)
Expand All @@ -27,13 +30,13 @@ jobs:
working-directory: ../
id: create-archive
run: |
tar cJf cosmo-vendored-${{ env.REGISTRY_TAG }}.tar.xz cosmo-${{ env.REGISTRY_TAG }}
echo "archive_file_name=$(realpath ./cosmo-vendored-${{ env.REGISTRY_TAG }}.tar.xz)" >> $GITHUB_OUTPUT
tar cJf cosmo-vendored-${{ env.TAG }}.tar.xz cosmo-${{ env.TAG }}
echo "archive_file_name=$(realpath ./cosmo-vendored-${{ env.TAG }}.tar.xz)" >> $GITHUB_OUTPUT
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: binaries-${{ env.REGISTRY_TAG }}
name: binaries-${{ env.TAG }}
path: ${{ steps.create-archive.outputs.archive_file_name }}
if-no-files-found: error
retention-days: 1
Expand All @@ -60,6 +63,10 @@ jobs:
with:
target: ${{ matrix.platform.target }}

- name: Install musl-gcc
if: ${{ endsWith(matrix.platform.target, 'musl') }}
run: sudo apt install -y musl-tools

- name: Build Release
run: cargo build --locked --target=${{ matrix.platform.target }} ${{ matrix.platform.args }} --release

Expand All @@ -77,7 +84,7 @@ jobs:
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: binaries-${{ env.REGISTRY_TAG }}
name: binaries-${{ env.TAG }}
path: ${{ steps.rename_binary.outputs.binary_name }}
if-no-files-found: error
retention-days: 1
Expand All @@ -92,15 +99,15 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: binaries-${{ env.REGISTRY_TAG }}
name: binaries-${{ env.TAG }}
path: /tmp/binaries

- name: Release
uses: ncipollo/release-action@v1
with:
name: ${{ env.REGISTRY_TAG }}
name: ${{ env.TAG }}
draft: true
tag: ${{ env.REGISTRY_TAG }}
tag: ${{ env.TAG }}
artifacts: "/tmp/binaries/*"
body: |
<hr>
Expand Down

0 comments on commit 589e35a

Please sign in to comment.