Skip to content

fix: update package version to 0.1.4 #5

fix: update package version to 0.1.4

fix: update package version to 0.1.4 #5

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build - ${{ matrix.platform.release_for }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- release_for: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
bin: cct
name: cct-Linux-x86_64.tar.gz
command: build
- release_for: macOS-x86_64
os: macos-latest
target: x86_64-apple-darwin
bin: cct
name: cct-Darwin-x86_64.tar.gz
command: build
- release_for: macOS-aarch64
os: macos-latest
target: aarch64-apple-darwin
bin: cct
name: cct-Darwin-aarch64.tar.gz
command: build
- release_for: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: cct.exe
name: cct-Windows-x86_64.zip
command: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform.target }}
- name: Install dependencies (Ubuntu)
if: matrix.platform.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Build
run: cargo build --release --target ${{ matrix.platform.target }}
- name: Package (Unix)
if: matrix.platform.os != 'windows-latest'
run: |
cd target/${{ matrix.platform.target }}/release
tar czf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
cd -
- name: Package (Windows)
if: matrix.platform.os == 'windows-latest'
run: |
cd target/${{ matrix.platform.target }}/release
7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
cd -
- name: Generate checksum
shell: bash
run: |
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then
certutil -hashfile ${{ matrix.platform.name }} SHA256 | sed -n '2p' | tr -d '\r' > ${{ matrix.platform.name }}.sha256
else
shasum -a 256 ${{ matrix.platform.name }} > ${{ matrix.platform.name }}.sha256
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.name }}
path: ${{ matrix.platform.name }}
- name: Upload checksums
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.name }}.sha256
path: ${{ matrix.platform.name }}.sha256
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate Release Notes
run: |
echo "## What's Changed" > release_notes.md
echo "" >> release_notes.md
echo "Full Changelog: [compare](https://github.com/${{ github.repository }}/compare/${{ github.event.before }}...${{ github.ref_name }})" >> release_notes.md
echo "" >> release_notes.md
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body_path: release_notes.md
draft: false
prerelease: false
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}