Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from GossiperLoturot/ci/release
Browse files Browse the repository at this point in the history
change github action on release
  • Loading branch information
GossiperLoturot committed Jan 13, 2023
2 parents 86b0fd1 + 16fd255 commit e0668fa
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 12 deletions.
68 changes: 56 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,63 @@ env:
CARGO_TERM_COLOR: always

jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
build:
strategy:
fail-fast: false
matrix:
target: [x86_64-unknown-linux-musl, x86_64-pc-windows-gnu, x86_64-apple-darwin]
include:
- os: ubuntu-latest
bin-path: target/release/docker-fire
- os: macos-latest
bin-path: target/release/docker-fire
- os: windows-latest
bin-path: target/release/docker-fire.exe

name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Compile
run: cargo build --release
- name: Archive
id: archive
shell: bash
run: |
NAME=docker-fire-${{ github.ref_name }}-${{ matrix.os }}
DIR_PATH=$NAME
mkdir $DIR_PATH
mv ${{ matrix.bin-path }} $DIR_PATH/
if ${{ matrix.os == 'windows-latest' }}; then
ARCHIVE_PATH=$NAME.zip
7z a $ARCHIVE_PATH $DIR_PATH
else
ARCHIVE_PATH=$NAME.tar.gz
tar -czvf $ARCHIVE_PATH $DIR_PATH
fi
echo "path=$ARCHIVE_PATH" >> $GITHUB_OUTPUT
- name: Upload
uses: actions/upload-artifact@v3
with:
name: assets
path: ${{ steps.archive.outputs.path }}

release:
name: Release
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
EXTRA_FILES: "README.md LICENSE"
- name: Download
uses: actions/download-artifact@v3
with:
name: assets
path: assets
- name: Release
uses: softprops/action-gh-release@v1
with:
files: assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -17,6 +18,7 @@ jobs:
run: cargo test --verbose

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down

0 comments on commit e0668fa

Please sign in to comment.