Release #3
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
name: Release | |
on: | |
workflow_dispatch | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build csdemoparser | |
run: cargo build -p csdemoparser --release | |
- name: Test csdemoparser | |
run: cargo test -p csdemoparser --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: linux | |
path: target/release/csdemoparser | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build csdemoparser | |
run: cargo build -p csdemoparser --release | |
- name: Test csdemoparser | |
run: cargo test -p csdemoparser --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: target/release/csdemoparser.exe | |
package: | |
runs-on: ubuntu-latest | |
needs: [linux, windows] | |
steps: | |
- uses: actions/checkout@v4 | |
# oldui | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- run: npm install -g bower | |
- run: bower install | |
# Clojure | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Install Leiningen | |
uses: DeLaGuardo/[email protected] | |
with: | |
lein: '2.10.0' | |
- name: Cache Clojure dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: cljdeps-${{ hashFiles('project.clj') }} | |
restore-keys: cljdeps- | |
- name: Build jar | |
run: LEIN_SNAPSHOTS_IN_RELEASE=1 lein uberjar | |
# Package | |
- uses: actions/download-artifact@v4 | |
with: | |
path: release | |
- name: Prepare Windows files | |
run: | | |
cp target-lein/hsbox-*-standalone.jar release/windows/hsbox-standalone.jar | |
echo 'start javaw -jar hsbox-standalone.jar --port 4000 --systray' > release/windows/headshotbox.bat | |
echo 'java -jar hsbox-standalone.jar --port 4000' > release/windows/headshotbox_console.bat | |
zip -j headshotbox-win.zip release/windows | |
- name: Prepare Linux files | |
run: | | |
cp target-lein/hsbox-*-standalone.jar release/linux/hsbox-standalone.jar | |
echo 'java -jar hsbox-standalone.jar --port 4000' > release/linux/headshotbox.sh | |
chmod a+x release/linux/headshotbox.sh | |
zip -j headshotbox-linux.zip release/linux | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: | | |
headshotbox-linux.zip | |
headshotbox-win.zip |