Merge pull request #2 from SergioGasquez/main
Add CI to generate release packages
This commit is contained in:
commit
946047a58c
53
.github/workflows/package.yml
vendored
Normal file
53
.github/workflows/package.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
name: Package
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runs_on:
|
||||
required: true
|
||||
type: string
|
||||
target:
|
||||
required: true
|
||||
type: string
|
||||
extension:
|
||||
default: ""
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build static binaries
|
||||
runs-on: ${{ inputs.runs_on }}
|
||||
|
||||
steps:
|
||||
- name: Change apt mirror and install dependencies
|
||||
if: ${{ inputs.runs_on == 'ubuntu-latest' }}
|
||||
run: |
|
||||
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install musl-tools libudev-dev
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ inputs.target }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --release --all --target ${{ inputs.target }}
|
||||
|
||||
- uses: papeloto/action-zip@v1
|
||||
with:
|
||||
files: target/${{ inputs.target }}/release/web-flash${{ inputs.extension }}
|
||||
recursive: true
|
||||
dest: web-flash-${{ inputs.target }}.zip
|
||||
|
||||
- uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: web-flash-${{ inputs.target }}.zip
|
||||
tag: ${{ github.ref }}
|
50
.github/workflows/release.yml
vendored
Normal file
50
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
# Linux
|
||||
|
||||
x86_64-unknown-linux-gnu:
|
||||
uses: ./.github/workflows/package.yml
|
||||
with:
|
||||
runs_on: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
|
||||
x86_64-unknown-linux-musl:
|
||||
uses: ./.github/workflows/package.yml
|
||||
with:
|
||||
runs_on: ubuntu-latest
|
||||
target: x86_64-unknown-linux-musl
|
||||
|
||||
# macOS
|
||||
|
||||
aarch64-apple-darwin:
|
||||
uses: ./.github/workflows/package.yml
|
||||
with:
|
||||
runs_on: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
|
||||
x86_64-apple-darwin:
|
||||
uses: ./.github/workflows/package.yml
|
||||
with:
|
||||
runs_on: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
|
||||
# Windows
|
||||
|
||||
x86_64-pc-windows-gnu:
|
||||
uses: ./.github/workflows/package.yml
|
||||
with:
|
||||
runs_on: windows-latest
|
||||
target: x86_64-pc-windows-gnu
|
||||
extension: .exe
|
||||
|
||||
x86_64-pc-windows-msvc:
|
||||
uses: ./.github/workflows/package.yml
|
||||
with:
|
||||
runs_on: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
extension: .exe
|
Loading…
Reference in New Issue
Block a user