v3.6.4 #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Add artifacts to release | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
release: | |
name: release ${{ matrix.target }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-musl | |
- target: x86_64-pc-windows-gnu | |
# TODO: How? | |
# - target: x86_64-unknown-linux-gnu | |
# - target: aarch64-unknown-linux-musl | |
steps: | |
- uses: actions/checkout@master | |
- name: Compile and release | |
uses: rust-build/rust-build.action@v1.4.3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
RUSTTARGET: ${{ matrix.target }} | |
TOOLCHAIN_VERSION: 1.78.0 | |
ARCHIVE_TYPES: tar.gz zip | |
EXTRA_FILES: LICENSE README.md sigi.1 | |
release-macos: | |
name: release ${{ matrix.target }} | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: aarch64-apple-darwin | |
- target: x86_64-apple-darwin | |
env: | |
ASSET_NAME: sigi_${{ github.event.release.tag_name }}_${{ matrix.target }} | |
RELEASE_URL: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets | |
steps: | |
- uses: actions/checkout@master | |
- run: rustup update stable && rustup default stable | |
- run: rustup target add ${{ matrix.target }} | |
- run: cargo build --target ${{ matrix.target }} --release --verbose | |
- run: cargo test --target ${{ matrix.target }} --release --verbose | |
- run: mv target/${{ matrix.target }}/release/sigi sigi | |
- run: zip ${{ env.ASSET_NAME }}.zip sigi LICENSE README.md sigi.1 | |
- run: shasum -a 256 ${{ env.ASSET_NAME }}.zip >${{ env.ASSET_NAME }}.zip.sha256sum | |
- run: tar -czvf ${{ env.ASSET_NAME }}.tar.gz sigi LICENSE README.md sigi.1 | |
- run: shasum -a 256 ${{ env.ASSET_NAME }}.tar.gz >${{ env.ASSET_NAME }}.tar.gz.sha256sum | |
# https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset | |
- name: upload zip | |
run: | | |
curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/octet-stream" \ | |
"${{ env.RELEASE_URL}}?name=${{ env.ASSET_NAME }}.zip" \ | |
--data-binary "@${{ env.ASSET_NAME }}.zip" | |
- name: upload zip sha256sum | |
run: | | |
curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/octet-stream" \ | |
"${{ env.RELEASE_URL}}?name=${{ env.ASSET_NAME }}.zip.sha256sum" \ | |
--data-binary "@${{ env.ASSET_NAME }}.zip.sha256sum" | |
- name: upload tarball | |
run: | | |
curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/octet-stream" \ | |
"${{ env.RELEASE_URL}}?name=${{ env.ASSET_NAME }}.tar.gz" \ | |
--data-binary "@${{ env.ASSET_NAME }}.tar.gz" | |
- name: upload tarball sha256sum | |
run: | | |
curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/octet-stream" \ | |
"${{ env.RELEASE_URL}}?name=${{ env.ASSET_NAME }}.tar.gz.sha256sum" \ | |
--data-binary "@${{ env.ASSET_NAME }}.tar.gz.sha256sum" |