Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
talosross authored Nov 25, 2023
1 parent ca97ec9 commit fc35cd4
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
name: Release update
on:
workflow_dispatch:
inputs:
artifactName:
description: Artifact name
type: string
required: true
tagName:
description: Tag name
type: string
required: true
prerelease:
description: Prerelease
type: boolean
required: true
releaseName:
description: Release name
type: string
required: true
push:
branches:
- main # Ändere dies entsprechend deinem Standardzweig

jobs:
build-release-apk:
runs-on: ubuntu-latest
Expand All @@ -30,23 +16,22 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/gradle-build-action@v2
- name: Extract version info
id: extract-versions
run: |
VERSION_NAME=$(grep "versionName" app/build.gradle | awk '{print $2}' | sed "s/'//g")
VERSION_CODE=$(grep "versionCode" app/build.gradle | awk '{print $2}')
VERSION_NAME=$(cat app/build.gradle | grep "versionName" | sed -En 's/.*"(.+)".*/\1/p')
VERSION_CODE=$(cat app/build.gradle | grep "versionCode" | awk '{print $2}')
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
- name: Build release APK
run: ./gradlew assembleLawnWithQuickstepRelease
- name: Rename artifact
run: mv "build/outputs/apk/lawnWithQuickstep/release/app-release.apk" "${{ github.event.inputs.artifactName }}"
run: mv "build/outputs/apk/lawnWithQuickstep/release/app-release.apk" "ReleaseAPK-${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}.apk"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Release APK
path: ${{ github.event.inputs.artifactName }}
path: "ReleaseAPK-${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}.apk"
publish-github-release:
runs-on: ubuntu-latest
needs: build-release-apk
Expand All @@ -67,9 +52,8 @@ jobs:
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tagName }}
prerelease: ${{ github.events.inputs.prerelease }}
tag_name: "v${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}"
prerelease: false
draft: true
body_path: ${{ github.workspace }}/GITHUB_CHANGELOG.md
files: artifacts/release-apk/${{ github.event.inputs.artifactName }}
name: "${{ github.event.inputs.releaseName }} ($VERSION_NAME-$VERSION_CODE)"
files: artifacts/release-apk/ReleaseAPK-${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}.apk

0 comments on commit fc35cd4

Please sign in to comment.