iss_locator.rs/.forgejo/workflows/rust.yaml

37 lines
1.1 KiB
YAML
Raw Normal View History

2023-09-14 05:41:32 +00:00
name: Build and upload a binary on tag push
2023-09-16 00:42:31 +00:00
on:
push:
tags:
- 'v*'
2023-09-14 04:38:22 +00:00
2023-09-14 04:03:50 +00:00
jobs:
2023-09-14 14:11:12 +00:00
build-release:
2023-09-14 04:38:22 +00:00
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v3
2023-09-14 04:56:55 +00:00
- name: Setup toolchian
uses: https://github.com/dtolnay/rust-toolchain@stable
2023-09-14 04:38:22 +00:00
- name: Build
2023-09-14 14:07:00 +00:00
run: |
2023-09-16 03:21:50 +00:00
export BIN_NAME="iss_locator"
export VER=$(awk -F "=" '/version/ {print $2}' Cargo.toml | grep -o -e '[0-9]*\.[0-9]*\.[0-9]*')
2023-09-14 14:07:00 +00:00
cargo build --release
2023-09-16 00:40:27 +00:00
mkdir release
2023-09-16 03:21:50 +00:00
cp target/release/$BIN_NAME release/$BIN_NAME-$VER
chmod +x release/$BIN_NAME-$VER
xz --keep -9 release/$BIN_NAME-$VER
shasum -a 256 release/$BIN_NAME-$VER > release/$BIN_NAME-$VER.sha256
shasum -a 256 release/$BIN_NAME-$VER.xz > release/$BIN_NAME-$VER.xz.sha256
2023-09-14 04:38:22 +00:00
- name: Upload release
uses: actions/forgejo-release@v1
with:
2023-09-14 05:06:41 +00:00
direction: upload
2023-09-16 00:40:27 +00:00
url: https://git.technoduck.me
2023-09-14 04:38:22 +00:00
token: ${{secrets.app_token}}
2023-09-16 00:40:27 +00:00
release-dir: release
2023-09-14 05:41:32 +00:00
verbose: true
2023-09-14 04:38:22 +00:00