Skip to content

Refactor of the code and move Decompressor into own file #20

Refactor of the code and move Decompressor into own file

Refactor of the code and move Decompressor into own file #20

Workflow file for this run

name: Build & Push binaries
permissions:
contents: write
on:
push:
pull_request:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README.md'
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
platform:
- { runner: windows-latest, os: windows, arch: x64 }
- { runner: ubuntu-latest, os: linux, arch: x86_64 }
- { runner: macos-latest, os: macos, arch: x86_64 }
#- { runner: macos-latest, os: macos, arch: arm64 }
runs-on: ${{ matrix.platform.runner }}
steps:
- uses: actions/checkout@v3
- name: Build and install
run: cargo install --bins --path . --root install --verbose
- name: Set variables
run: |
FILENAME=this_updater_of_mine
if [ "$RUNNER_OS" == "Windows" ]; then
FILENAME=$FILENAME.exe
fi
echo "OUTPUT_PATH=install/bin/$FILENAME" >> $GITHUB_ENV
echo "ASSET_NAME=${{ matrix.platform.os }}_${{ matrix.platform.arch }}_$FILENAME" >> $GITHUB_ENV
shell: bash
- name: Compute checksum of binary
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
sha256sum -b "$OUTPUT_PATH" > "$ASSET_NAME.sha256"
else
shasum -a 256 -b "$OUTPUT_PATH" > "$ASSET_NAME.sha256"
fi
shell: bash
# Nightly tags (for commits to dev branch)
- name: Upload binaries to release (Dev)
uses: svenstaro/upload-release-action@v2
if: ${{ (github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.OUTPUT_PATH }}
asset_name: ${{ env.ASSET_NAME }}
tag: "0.0.0-nightly"
overwrite: true
body: "Dev branch"
- name: Upload checksum to release (Dev)
uses: svenstaro/upload-release-action@v2
if: ${{ (github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ASSET_NAME }}.sha256
asset_name: ${{ env.ASSET_NAME }}.sha256
tag: "0.0.0-nightly"
overwrite: true
body: "Dev branch"
# Release tags (for tags)
- name: Upload binaries to release (Tag)
uses: svenstaro/upload-release-action@v2
if: ${{ startsWith(github.event.ref, 'refs/tags/') }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.OUTPUT_PATH }}
asset_name: ${{ env.ASSET_NAME }}
tag: ${{ github.ref }}
overwrite: true
body: Version ${{ github.ref }}
- name: Upload checksum to release (Tag)
uses: svenstaro/upload-release-action@v2
if: ${{ startsWith(github.event.ref, 'refs/tags/') }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ASSET_NAME }}.sha256
asset_name: ${{ env.ASSET_NAME }}.sha256
tag: ${{ github.ref }}
overwrite: true
body: Version ${{ github.ref }}