Skip to content

Commit

Permalink
Update release.yml to release on tag creation
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ authored Jul 25, 2023
1 parent bf00809 commit 05a9f59
Showing 1 changed file with 50 additions and 16 deletions.
66 changes: 50 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,53 @@
name: Release Pillarbox
on:
workflow_dispatch:

push:
# Pattern matched against refs/tags
tags:
- '[0-9]+.[0-9].[0-9]'
- '[0-9]+.[0-9].[0-9]-[0-9a-zA-Z]+'
jobs:
PublishRelease:
name: Build and upload library to Github packages
uses: ./.github/workflows/publish-library.yml
with:
isSnapshot: false
secrets: inherit
UploadDemo:
name: Upload Demo to Firebase AppDistribution
uses: ./.github/workflows/publish-demo.yml
secrets:
KEY_PASSWORD: ${{ secrets.DEMO_KEY_PASSWORD }}
FIREBASE_CREDENTIAL_FILE_CONTENT: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }}
FIREBASE_GROUP: ${{ secrets.RELEASE_GROUPS }}
FIREBASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
build:
runs-on: ubuntu-latest
env:
DEMO_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- name: Check if pre release tag
id: check-tag
run: |
if [[ "${GITHUB_REF_NAME}" =~ [0-9]+.[0-9].[0-9]-[0-9a-zA-Z]+ ]]; then
echo "prerelease=true" >> $GITHUB_OUTPUT
fi
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
# the publishing section of your build.gradle
- name: Publish to GitHub Packages
uses: gradle/[email protected]
with:
arguments: publishProdRelease
- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: assembleProdRelease
- name: upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }}
groups: ${{ secrets.RELEASE_GROUPS }}
file: pillarbox-demo/build/outputs/apk/release/pillarbox-demo-release.apk
- uses: ncipollo/release-action@v1
- name: Create Github release
with:
draft: true
prerelease: steps.check-tag.outputs.prerelease == 'true'
skipIfReleaseExists: true
generateReleaseNotes: true

0 comments on commit 05a9f59

Please sign in to comment.