Skip to content

Commit

Permalink
Release on tag push.
Browse files Browse the repository at this point in the history
  • Loading branch information
abenea committed Feb 9, 2024
1 parent 9e5f0b9 commit 2328f48
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 131 deletions.
100 changes: 50 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,92 @@ name: Build
on:
push:
branches: [ "master" ]
tags:
- v*

env:
CARGO_TERM_COLOR: always

jobs:
linux:
runs-on: ubuntu-20.04
build:
strategy:
matrix:
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Test csdemoparser
- name: Test
run: cargo test --release
- name: Build csdemoparser
run: cargo build -p csdemoparser --release
- uses: actions/upload-artifact@v4
with:
name: rust-linux
path: target/release/csdemoparser

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Test csdemoparser
run: cargo test --release
- name: Build csdemoparser
run: cargo build -p csdemoparser --release
- uses: actions/upload-artifact@v4
with:
name: rust-windows
path: target/release/csdemoparser.exe
name: ${{ matrix.os }}
path: |
target/release/csdemoparser
target/release/csdemoparser.exe
package:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [linux, windows]
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# oldui
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'src/newui/package-lock.json'
# cache: 'npm'
# cache-dependency-path: 'src/newui/package-lock.json'
- run: npm install -g bower
- run: bower install
# newui
- name: newui
run: |
cd src/newui
npm install
npm run build
cp -R dist/spa/* ../../resources/public/
# - name: newui
# run: |
# cd src/newui
# npm install
# npm run build
# cp -R dist/spa/* ../../resources/public/
# Clojure
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Install Leiningen
uses: DeLaGuardo/setup-clojure@11.0
uses: DeLaGuardo/setup-clojure@12.3
with:
lein: '2.10.0'
- name: Cache Clojure dependencies
uses: actions/cache@v3
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
- run: |
mv target-lein/hsbox-*-standalone.jar target-lein/hsbox-standalone.jar
echo 'java -jar hsbox-standalone.jar --port 4000' > target-lein/headshotbox.sh
chmod a+x target-lein/headshotbox.sh
# Package
- uses: actions/download-artifact@v3
with:
name: rust-linux
path: release
- uses: actions/download-artifact@v3
with:
name: rust-windows
path: release
- name: Zip
run: zip -j headshotbox.zip target-lein/hsbox-standalone.jar target-lein/headshotbox.sh release/csdemoparser release/csdemoparser.exe
- uses: actions/upload-artifact@v3
- uses: actions/download-artifact@v4
- name: Package Windows
run: |
mkdir -p windows/headshotbox
cp windows-latest/csdemoparser.exe windows/headshotbox/
cp target-lein/hsbox-*-standalone.jar windows/headshotbox/hsbox-standalone.jar
echo 'start javaw -jar hsbox-standalone.jar --port 4000 --systray' > windows/headshotbox/headshotbox.bat
echo 'java -jar hsbox-standalone.jar --port 4000' > windows/headshotbox/headshotbox_console.bat
cd windows && zip ../headshotbox-win.zip headshotbox/*
- name: Package Linux
run: |
mkdir -p linux/headshotbox
cp ubuntu-20.04/csdemoparser linux/headshotbox/
cp target-lein/hsbox-*-standalone.jar linux/headshotbox/hsbox-standalone.jar
echo 'java -jar hsbox-standalone.jar --port 4000' > linux/headshotbox/headshotbox.sh
chmod a+x linux/headshotbox/headshotbox.sh linux/headshotbox/csdemoparser
cd linux && zip ../headshotbox-linux.zip headshotbox/*
- name: Release
uses: softprops/action-gh-release@v1
with:
name: headshotbox
path: headshotbox.zip
draft: true
files: |
headshotbox-linux.zip
headshotbox-win.zip
81 changes: 0 additions & 81 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 2328f48

Please sign in to comment.