Merge pull request #50 from yanorei32/renovate/actions-checkout-4.x #54
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
on: | |
push: | |
branches: | |
- "master" | |
tags: | |
- "v*" | |
env: | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- run: | | |
sudo apt-get update -y | |
sudo apt-get install -y gcc-mingw-w64-x86-64 | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
target: x86_64-pc-windows-gnu | |
- name: cache dependencies | |
uses: Swatinem/[email protected] | |
- name: clippy check | |
uses: actions-rs/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-features | |
- name: install cargo-license | |
uses: actions-rs/[email protected] | |
with: | |
command: install | |
args: cargo-license | |
- uses: actions-rs/[email protected] | |
with: | |
command: build | |
args: --release --target x86_64-pc-windows-gnu | |
- run: | | |
mkdir winresz | |
cargo license \ | |
--authors \ | |
--do-not-bundle \ | |
--avoid-dev-deps \ | |
--avoid-build-deps \ | |
--filter-platform x86_64-pc-windows-gnu \ | |
> winresz/CREDITS | |
VERSION_NAME=${GITHUB_REF##*/} | |
if [[ $VERSION_NAME == "master" ]]; then | |
VERSION_NAME=$(git rev-parse --short HEAD) | |
elif [[ ${VERSION_NAME:0:1} == "v" ]]; then | |
VERSION_NAME=${VERSION_NAME:1} | |
fi | |
echo "$VERSION_NAME" > winresz/VERSION.txt | |
cp LICENSE README.md winresz/ | |
cp target/x86_64-pc-windows-gnu/release/winresz.exe winresz/ | |
zip -r winresz.zip winresz | |
- name: pre-release | |
uses: marvinpinto/action-automatic-releases@latest | |
if: "! startsWith(github.ref, 'refs/tags/')" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
winresz.zip | |
- name: tagged-release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
winresz.zip |