Skip to content

Commit

Permalink
Tweak release
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhickman committed Jun 26, 2023
1 parent 1507806 commit 39cfff1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 59 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/ci.yml

This file was deleted.

40 changes: 30 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
tags:
- '*'
- "*"

jobs:
build:
Expand All @@ -11,10 +11,8 @@ jobs:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary: lanquetta
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: lanquetta.exe
runs-on: ${{ matrix.os }}
steps:
- name: Install packages
Expand All @@ -33,28 +31,50 @@ jobs:
with:
submodules: true

- run: cargo fetch

- name: Release build
run: cargo build --release

- run: chmod +x target/release/${{ matrix.binary }}
- run: |
chmod +x target/release/lanquetta
tar czf lanquetta-${{ matrix.target }}.tar.gz target/release/lanquetta
if: matrix.target == 'x86_64-unknown-linux-gnu'
- run: |
7z a lanquetta-${{ matrix.target }}.zip target/release/lanquetta.exe
if: matrix.target == 'x86_64-pc-windows-msvc'
- name: Upload binary
uses: actions/upload-artifact@v3
if: matrix.target == 'x86_64-unknown-linux-gnu'
with:
name: lanquetta-${{ matrix.target }}
path: lanquetta-${{ matrix.target }}.tar.gz
retention-days: 3

- name: Upload binary
uses: actions/upload-artifact@v3
if: matrix.target == 'x86_64-pc-windows-msvc'
with:
name: lanqetta-${{ matrix.target }}
path: target/release/${{ matrix.binary }}
name: lanquetta-${{ matrix.target }}
path: lanquetta-${{ matrix.target }}.zip
retention-days: 3

release:
name: Release
runs-on: ubuntu-22.04
needs: build
permissions: write-all
steps:
- uses: actions/download-artifact@v3
- name: Download Linux binary
uses: actions/download-artifact@v3
with:
name: lanquetta-x86_64-unknown-linux-gnu

- name: Download Windows binary
uses: actions/download-artifact@v3
with:
name: lanquetta-x86_64-pc-windows-msvc

- run: gh release create --repo ${{ github.repository }} ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes ./lanqetta-x86_64-pc-windows-msvc/lanquetta.exe ./lanqetta-x86_64-unknown-linux-gnu/lanquetta
- run: gh release create --repo ${{ github.repository }} ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes lanquetta-x86_64-unknown-linux-gnu.tar.gz lanquetta-x86_64-pc-windows-msvc.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 39cfff1

Please sign in to comment.