Skip to content

Commit

Permalink
CI: Hopefully fix artifact releases
Browse files Browse the repository at this point in the history
Issue #32
  • Loading branch information
AngheloAlf committed Feb 22, 2024
1 parent ab09d4a commit 753ab96
Showing 1 changed file with 35 additions and 16 deletions.
51 changes: 35 additions & 16 deletions .github/workflows/publish_crate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,39 @@ jobs:


release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
name: release artifact for ${{ matrix.builder.target }}
runs-on: ${{ matrix.builder.runner }}
needs: [check_fmt, check_clippy] # run_tests

strategy:
fail-fast: false
matrix:
target:
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
- aarch64-apple-darwin
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-gnu
builder: [
{
target: x86_64-pc-windows-gnu,
runner: windows-2019
},
{
target: x86_64-pc-windows-msvc,
runner: windows-2019
},
{
target: x86_64-apple-darwin,
runner: macos-12
},
{
target: aarch64-apple-darwin,
runner: macos-13-xlarge
},
{
target: x86_64-unknown-linux-musl,
runner: ubuntu-20.04
},
{
target: x86_64-unknown-linux-gnu,
runner: ubuntu-20.04
}
]

steps:
- name: Checkout repo
Expand All @@ -82,36 +101,36 @@ jobs:
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
targets: ${{ matrix.builder.target }}

- name: Build cli
run: cargo build --release --target ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.builder.target }}

- name: Move files for packaging
run: |
mkdir -p package/
cp target/${{ matrix.target }}/release/slinky-cli package/ || cp target/${{ matrix.target }}/release/slinky-cli.exe package/
cp target/${{ matrix.builder.target }}/release/slinky-cli package/ || cp target/${{ matrix.builder.target }}/release/slinky-cli.exe package/
cp LICENSE package/slinky-cli.LICENSE
cp README.md package/slinky-cli.README.md
tree package
- name: Package .tar.gz
run: |
cd package && tar -czf ../slinky-cli-${{ matrix.crate-type }}-${{ matrix.target }}.tar.gz *
cd package && tar -czf ../slinky-cli-${{ matrix.crate-type }}-${{ matrix.builder.target }}.tar.gz *
- name: Upload .tar.gz artifact
uses: actions/upload-artifact@v3
with:
name: slinky-cli-${{ matrix.crate-type }}-${{ matrix.target }}
name: slinky-cli-${{ matrix.crate-type }}-${{ matrix.builder.target }}
path: |
slinky-cli-${{ matrix.crate-type }}-${{ matrix.target }}.tar.gz
slinky-cli-${{ matrix.crate-type }}-${{ matrix.builder.target }}.tar.gz
if-no-files-found: error

- name: Publish .tar.gz release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && matrix.archive == 'tar.gz'
with:
files: slinky-cli-${{ matrix.crate-type }}-${{ matrix.target }}.tar.gz
files: slinky-cli-${{ matrix.crate-type }}-${{ matrix.builder.target }}.tar.gz

publish:
name: Publish
Expand Down

0 comments on commit 753ab96

Please sign in to comment.