-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38b7788
commit e80719d
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Run Gradle build on push | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: corretto | ||
java-version: 17 | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Pass tests and checks | ||
run: ./gradlew check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Upload Release Asset | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
build: [ linux, windows, macos ] | ||
include: | ||
- build: linux | ||
os: ubuntu-latest | ||
exec: theintercept | ||
platform: x86_64-linux | ||
- build: macos | ||
os: macos-latest | ||
exec: theintercept.app | ||
platform: x86_64-macos | ||
- build: windows | ||
os: windows-latest | ||
exec: theintercept | ||
platform: x86_64-windows | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: corretto | ||
java-version: 17 | ||
- name: Build package | ||
run: | | ||
VERSION=${{ github.event.release.tag_name}} | ||
VERSION=${VERSION:1 } | ||
# replace version property in inkplayer.properties | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
sed -i '' -e "s/version=.*/version=$VERSION/" assets/inkplayer.properties | ||
else | ||
sed -i -e "s/version=.*/version=$VERSION/" assets/inkplayer.properties | ||
fi | ||
./gradlew lwjgl3:jpackageImage | ||
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | ||
echo "${{ secrets.KEYSTORE }}" | base64 --decode > $HOME/keystore.jks | ||
VERSION_CODE=$((`echo $VERSION | cut -d. -f1` * 100 + `echo $VERSION | cut -d. -f2`)) | ||
./gradlew -Pkeystore=$HOME/keystore.jks -PstorePassword=${{ secrets.KEYSTORE_PASSWORD }} -Palias=${{ secrets.KEYALIAS }} -PkeyPassword=${{ secrets.KEY_PASSWORD }} android:assembleRelease -Pversion=$VERSION -PversionCode=$VERSION_CODE | ||
fi | ||
shell: bash | ||
- name: Upload app image to Github release | ||
run: | | ||
staging="theintercept-${{github.event.release.tag_name}}-${{ matrix.platform }}" | ||
mkdir "$staging" | ||
cp -r lwjgl3/build/jpackage/${{ matrix.exec }} "$staging/" | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
7z a "$staging.zip" "$staging" | ||
gh release upload ${{github.event.release.tag_name}} "$staging.zip" | ||
else | ||
tar czf "$staging.tar.gz" "$staging" | ||
gh release upload ${{github.event.release.tag_name}} "$staging.tar.gz" | ||
# Upload Android app if ubuntu-latest | ||
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | ||
staging="theintercept-${{github.event.release.tag_name}}" | ||
mv android/build/outputs/apk/release/android-release.apk "android/build/outputs/apk/release/theintercept-${{github.event.release.tag_name}}.apk" | ||
gh release upload ${{github.event.release.tag_name}} "android/build/outputs/apk/release/theintercept-${{github.event.release.tag_name}}.apk" | ||
fi | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ github.TOKEN }} | ||
shell: bash |