Skip to content

Commit

Permalink
release me
Browse files Browse the repository at this point in the history
  • Loading branch information
iambenzo committed Nov 20, 2024
1 parent 45d6ba6 commit 13d9cb0
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# on:
# push:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Release Me!
on: workflow_dispatch
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
rust-target: x86_64-pc-windows-msvc
artifact-name: win64
artifact-cli: ktr.exe
artifact-gui: ktr_gui.exe
tar: false
- os: ubuntu-20.04
rust-target: x86_64-unknown-linux-gnu
artifact-name: linux
artifact-cli: ktr
artifact-gui: ktr_gui
tar: true
- os: macos-13
rust-target: x86_64-apple-darwin
artifact-name: mac
artifact-cli: ktr
artifact-gui: ktr_gui
tar: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.7'
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mtkennerly/dunamai-action@v1
with:
env-var: KTR_VERSION
args: --style semver
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable-${{ matrix.rust-target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.rust-target }}
- if: ${{ matrix.os == 'ubuntu-20.04' }}
run: sudo apt-get update && sudo apt-get install -y gcc libxcb-composite0-dev libgtk-3-dev
- run: cargo build --release
- if: ${{ matrix.tar }}
run: |
cd target/release
tar --create --gzip --file=ktr-v${{ env.KTR_VERSION }}-${{ matrix.artifact-name }}.tar.gz ${{ matrix.artifact-cli }} ${{ matrix.artifact-gui }}
- if: ${{ matrix.tar }}
uses: actions/upload-artifact@v4
with:
name: ktr-v${{ env.KTR_VERSION }}-${{ matrix.artifact-name }}
path: target/release/ktr-v${{ env.KTR_VERSION }}-${{ matrix.artifact-name }}.tar.gz
- if: ${{ !matrix.tar }}
run: |
cd target/release
7z a -tzip ktr-v${{ env.KTR_VERSION }}-${{ matrix.artifact-name }}.zip ${{ matrix.artifact-cli }} ${{ matrix.artifact-gui }}
- if: ${{ !matrix.tar }}
uses: actions/upload-artifact@v4
with:
name: ktr-v${{ env.KTR_VERSION }}-${{ matrix.artifact-name }}
path: target/release/${{ matrix.artifact-cli }}

0 comments on commit 13d9cb0

Please sign in to comment.