BUILD BE release #290
Workflow file for this run
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: | | |
echo "RELEASE_TAG=${GITHUB_REF_NAME}-build" >> $GITHUB_ENV | |
echo "RELEASE_TAG=${GITHUB_REF_NAME}-build" | |
echo "RELEASE_VERSION=$(date +'%Y.%m.%d').${GITHUB_RUN_NUMBER}-${GITHUB_REF_NAME}" >> $GITHUB_ENV | |
echo "${{ secrets.KEYSTORE_BASE64 }}" > keystore.txt | |
openssl enc -d -base64 -in keystore.txt -out ../bekeystore.jks | |
- name: Create artifacts | |
env: | |
keystore_password: ${{ secrets.KEYSTORE_PASSWORD_SECRET }} | |
keystore_alias_password: ${{ secrets.KEYSTORE_PASSWORD_SECRET }} | |
keystore_alias: MindustryX | |
run: | | |
gradle desktop:dist android:assembleRelease server:dist -Pbuildversion=${RELEASE_VERSION} | |
- name: Move artifacts | |
run: | | |
mkdir artifacts | |
mv desktop/build/libs/Mindustry.jar artifacts/MindustryX-${{env.RELEASE_VERSION}}-Desktop.jar | |
mv android/build/outputs/apk/release/android-release.apk artifacts/MindustryX-${{env.RELEASE_VERSION}}-Android.apk | |
mv work/server/build/libs/server-release.jar artifacts/server-${{env.RELEASE_VERSION}}.jar | |
- name: Update Tag | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: ${{ env.RELEASE_TAG }} | |
force_push_tag: true | |
- name: Release | |
uses: softprops/action-gh-release@v2.0.2 | |
with: | |
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: ${{github.token}} | |
TAG: ${{ env.RELEASE_TAG }} |