From c6692d0957de081f5fac559e7196d46ba55f8237 Mon Sep 17 00:00:00 2001 From: Khaled Nassar Date: Mon, 25 Apr 2022 07:04:10 +0200 Subject: [PATCH] release --- .github/workflows/release.yml | 75 +++++++++++++++-------------------- 1 file changed, 32 insertions(+), 43 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67b25b4b..074ccca2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,53 +1,42 @@ -name: Build Binaries +name: Release + +on: + push: + tags: + - v[0-9]+.* -on: - release: - types: # This configuration does not affect the page_build event above - - created jobs: - build_for_mac: - name: MacOS - runs-on: macos-10.15 + create-release: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - name: Rename binary - run: mv target/release/scant3r scant3r-macos64 - - name: strip - run: strip scant3r-macos64 - - name: Upload to release + - uses: actions/checkout@v3 + - uses: taiki-e/create-gh-release-action@v1 env: + # (required) GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - curl \ - -f \ - -sSL \ - -XPOST \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Content-Length: $(stat -f%z scant3r-macos64)" \ - -H "Content-Type: application/octet-stream" \ - --upload-file "scant3r-macos64" \ - "https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)/assets?name=scant3r-macos64" - build_for_linux: - name: Linux - runs-on: ubuntu-18.04 + upload-assets: + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@master - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - name: Rename binary - run: mv target/release/scant3r scant3r-linux-amd64 - - name: strip - run: strip scant3r-linux-amd64 - - name: Upload to release - uses: JasonEtco/upload-to-release@d648f1babf776de9cad881320bd9e9818fc3b262 + - uses: actions/checkout@v3 + - uses: taiki-e/upload-rust-binary-action@v1 with: - args: scant3r-linux-amd64 application/octet-stream + # (required) + bin: scant3r + # (optional) On which platform to distribute the `.tar.gz` file. + # [default value: unix] + # [possible values: all, unix, windows, none] + tar: unix + # (optional) On which platform to distribute the `.zip` file. + # [default value: windows] + # [possible values: all, unix, windows, none] + zip: windows env: + # (required) GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}