From 9033a02927d9e41043a945fd2cca651220050503 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Thu, 26 May 2022 13:50:14 +0200 Subject: [PATCH] Add CI to generate release packages --- .github/workflows/package.yml | 46 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .github/workflows/package.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..9666fb8 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,46 @@ +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: + - 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 }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..732a8bd --- /dev/null +++ b/.github/workflows/release.yml @@ -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 \ No newline at end of file