Skip to content

chore: fmt, bump 0.40.0 #43

chore: fmt, bump 0.40.0

chore: fmt, bump 0.40.0 #43

Workflow file for this run

name: release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Get the version
id: get_version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Build changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configuration: .release.json
commitMode: true
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: ${{ steps.get_version.outputs.version }} 🎉
body: ${{ steps.github_release.outputs.changelog }}
create-binaries:
name: release ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
archive: zip
os: windows-latest
bin: .exe
ext: .zip
- target: x86_64-unknown-linux-gnu
archive: tar
ext: .tar.gz
os: ubuntu-latest
bin: ''
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
target: ${{ matrix.target }}
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: ikalnytskyi/action-setup-postgres@v4
if: matrix.target == 'x86_64-pc-windows-msvc'
- name: Build in release mode
uses: actions-rs/cargo@v1
with:
command: build
args: --release --features runtime_env
- name: Move release files
run: |
mkdir release
mv target/release/statpixel${{ matrix.bin }} release/statpixel${{ matrix.bin }}
cp README.md release/README.md
cp LICENSE release/LICENSE
- name: Archive release
uses: thedoctor0/zip-release@main
with:
type: ${{ matrix.archive }}
filename: release${{ matrix.ext }}
directory: release
path: '*'
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release/release${{ matrix.ext }}
asset_name: ${{ matrix.target }}${{ matrix.ext }}
tag: ${{ github.ref }}
overwrite: false