Skip to content

Commit

Permalink
add linux
Browse files Browse the repository at this point in the history
  • Loading branch information
RuyerZ committed Jul 16, 2022
1 parent d038d30 commit 98185f6
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions .github/workflows/build2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,65 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NAME }}
name: ${{ env.RELEASE_NAME }}-windows
path: archive/*

- name: 7Z
shell: bash
if: startsWith(github.ref, 'refs/tags/')
run: |
cd archive
7z a $RELEASE_NAME.7z *
7z a $RELEASE_NAME-windows.7z *
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: archive/${{ env.RELEASE_NAME }}.7z
files: archive/${{ env.RELEASE_NAME }}-windows.7z

Build-Linux-x64:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: cargo build --verbose --release
env:
RUST_BACKTRACE: 1

- name: Archive
shell: bash
run: |
BINARIES="$(cargo read-manifest | jq -r ".targets[] | select(.kind[] | contains(\"bin\")) | .name")"
mkdir archive
cd target/release
cp $BINARIES ../../archive/
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NAME }}-linux
path: archive/*

- name: TARGZ
shell: bash
if: startsWith(github.ref, 'refs/tags/')
run: |
cd archive
tar -czf $RELEASE_NAME-linux.tar.gz *
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: archive/${{ env.RELEASE_NAME }}-linux.tar.gz

0 comments on commit 98185f6

Please sign in to comment.