Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Grégoire Henry committed Dec 14, 2023
1 parent 9324d65 commit 5eb4f9e
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 87 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ jobs:
- name: Get SDL2
run: |
echo "matrix: $MATRIX_OS"
echo "matrix: ${{ matrix.os }}"
echo "runner: $RUNNER_OS"
echo "runner: ${{ runner.os }}"
if [ $MATRIX_OS == "ubuntu-latest" ]; then
if [ ${{ matrix.os }} == "ubuntu-latest" ]; then
sudo apt install -y libsdl2-dev
elif [ ${{ matrix.os }} == "macos-latest" ]; then
brew install SDL2
Expand Down
78 changes: 72 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,83 @@ jobs:
restore-keys: |
${{ runner.os }}-build-
- name: Get SDL2
run: |
if [ ${{ matrix.os }} == "ubuntu-latest" ]; then
sudo apt install -y libsdl2-dev
elif [ ${{ matrix.os }} == "macos-latest" ]; then
brew install SDL2
elif [ ${{ matrix.os }} == "windows-latest" ]; then
cp include/windows/* .
fi
- name: Set environment
run: ./compile/environment.sh
run: |
if [ ${{ matrix.os }} == "ubuntu-latest" ]; then
PLATFORM=ubuntu
elif [ ${{ matrix.os }} == "macos-latest" ]; then
PLATFORM=macos-x86_64
elif [ ${{ matrix.os }} == "windows-latest" ]; then
PLATFORM=windows
fi
- name: Get SDL2
run: ./compile/sdl.sh

if [ ${{ matrix.os }} == "windows-latest" ]; then
EXT=.exe
OUT_EXT=.exe
else
EXT=
OUT_EXT=.tar.gz
fi
BUNDLE_NAME=kalast-$GITHUB_REF_NAME-$PLATFORM
RELEASE_FILE=$BUNDLE_NAME$OUT_EXT
echo $PLATFORM
echo $EXT
echo $OUT_EXT
echo $BUNDLE_NAME
echo $RELEASE_FILE
echo "PLATFORM=$PLATFORM" >> "$GITHUB_ENV"
echo "EXT=$EXT" >> "$GITHUB_ENV"
echo "OUT_EXT=$OUT_EXT" >> "$GITHUB_ENV"
echo "BUNDLE_NAME=$BUNDLE_NAME" >> "$GITHUB_ENV"
echo "RELEASE_FILE=$RELEASE_FILE" >> "$GITHUB_ENV"
- name: Build
run: ./compile/build.sh
run: |
echo "Build main executable."
cargo build -r --all-features && strip target/release/kalast
echo "Build custom executable for specific example."
cargo build -r --all-features --example viewer-picker && strip target/release/examples/viewer-picker
- name: Bundle
run: ./compile/bundle.sh
run: |
mkdir -p bundle
cp -r examples bundle
cp target/release/kalast$EXT bundle
cp target/release/examples/viewer-picker$EXT bundle/examples/viewer-picker
cp include/kalast.ico bundle
cp -r include/assets bundle
cp preferences.yaml bundle
cp README.md bundle
if [ ${{ matrix.os }} == "windows-latest" ]; then
cp include/windows/* bundle
fi
cd bundle
cp -r examples/viewer/cfg .
cd ..
mv bundle $BUNDLE_NAME
if [ ${{ matrix.os }} == "windows-latest" ]; then
iscc compile/installer.iss /DVERSION=${{ github.ref_name }} /DSETUP_NAME=${{ env.RELEASE_FILE }} /DBUNDLE_PATH=.\bundle /DASSETS_PATH=.\assets
else
tar cvzf $RELEASE_FILE $BUNDLE_NAME
fi
- uses: softprops/action-gh-release@v1
with:
Expand Down
7 changes: 0 additions & 7 deletions compile/build.sh

This file was deleted.

26 changes: 0 additions & 26 deletions compile/bundle.sh

This file was deleted.

26 changes: 0 additions & 26 deletions compile/environment.sh

This file was deleted.

15 changes: 0 additions & 15 deletions compile/sdl.sh

This file was deleted.

0 comments on commit 5eb4f9e

Please sign in to comment.