fix ci #5
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: Build Artifacts | |
on: | |
push: | |
branches: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.6 | |
cache-read-only: false | |
build-scan-publish: true | |
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" | |
build-scan-terms-of-use-agree: "yes" | |
- name: Set env | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "github_actions" | |
echo "RELEASE_TAG=${GITHUB_REF_NAME}-build" >> $GITHUB_ENV | |
echo "RELEASE_TAG=${GITHUB_REF_NAME}-build" | |
echo "RELEASE_VERSION=$(date +'%Y.%m.%d').X${GITHUB_RUN_NUMBER}-${GITHUB_REF_NAME}" >> $GITHUB_ENV | |
echo "${{ secrets.KEYSTORE_BASE64 }}" | openssl enc -d -base64 -in - -out bekeystore.jks | |
- name: Build | |
run: | | |
git submodule update --init --depth=10 | |
cd work | |
../scripts/applyPatches.sh | |
gradle desktop:dist server:dist -Pbuildversion=${RELEASE_VERSION} | |
cd .. | |
mkdir artifacts | |
mv work/desktop/build/libs/Mindustry.jar artifacts/MindustryX-${{env.RELEASE_VERSION}}-Desktop.jar | |
mv work/server/build/libs/server-release.jar artifacts/server-${{env.RELEASE_VERSION}}.jar | |
- name: Build Android | |
env: | |
keystore_password: ${{ secrets.KEYSTORE_PASSWORD_SECRET }} | |
keystore_alias_password: ${{ secrets.KEYSTORE_PASSWORD_SECRET }} | |
keystore_alias: MindustryX | |
run: | | |
cd work | |
sed -i 's/tinylake.mindustryX/tinylake.mindustryX.be/g' android/build.gradle | |
sed -i 's/MindustryX/MindustryX BE/g' android/res/values/strings.xml | |
gradle android:assembleRelease -Pbuildversion=${RELEASE_VERSION} | |
cd .. | |
mv work/android/build/outputs/apk/release/android-release.apk artifacts/MindustryX-${{env.RELEASE_VERSION}}-Android.apk | |
# - name: Update Tag | |
# uses: rickstaa/action-create-tag@v1 | |
# with: | |
# tag: ${{ env.RELEASE_TAG }} | |
# force_push_tag: true | |
- name: Release | |
uses: softprops/[email protected] | |
with: | |
repository: TinyLake/MindustryX-work | |
token: ${{secrets.PUBLISH_TOKEN}} | |
tag_name: ${{ env.RELEASE_TAG }} | |
name: ${{ env.RELEASE_VERSION }} | |
target_commitish: ${{github.sha}} | |
files: artifacts/* | |
prerelease: true | |
- uses: oven-sh/setup-bun@v1 | |
- name: clearOldAssets | |
run: bun run .github/actions/clearOldAssets.ts | |
env: | |
GITHUB_TOKEN: ${{secrets.PUBLISH_TOKEN}} | |
GITHUB_REPOSITORY: TinyLake/MindustryX-work | |
TAG: ${{ env.RELEASE_TAG }} |