-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
20 changed files
with
225 additions
and
323 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 |
---|---|---|
|
@@ -18,11 +18,12 @@ jobs: | |
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
- uses: reviewdog/action-setup@v1 | ||
- name: Run android linter | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: lint | ||
arguments: lintProdDebug | ||
- name: review linter | ||
uses: dvdandroid/action-android-lint@master | ||
with: | ||
|
@@ -46,6 +47,7 @@ jobs: | |
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
- uses: reviewdog/action-setup@v1 | ||
- name: review detekt | ||
uses: alaegin/[email protected] | ||
|
@@ -75,7 +77,8 @@ jobs: | |
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
- name: Run android local unit test | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: testDebug | ||
arguments: testProdDebug |
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,83 @@ | ||
# Run nightly every nights at midnight or when triggered manually | ||
# https://github.com/orgs/community/discussions/27128 | ||
name: Publish demo nightly | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_name: | ||
description: 'version name as xx.yy.zz-Optional' | ||
required: true | ||
type: string | ||
schedule: | ||
- cron: '0 0 * * 1,5' | ||
|
||
jobs: | ||
check_date: | ||
runs-on: ubuntu-latest | ||
name: Check latest commit | ||
outputs: | ||
should_run: ${{ steps.should_run.outputs.should_run }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: print latest_commit | ||
run: echo ${{ github.sha }} | ||
- id: should_run | ||
continue-on-error: true | ||
name: check latest commit is less than a day | ||
if: ${{ github.event_name == 'schedule' }} | ||
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should_run=false" >> "$GITHUB_OUTPUT" | ||
|
||
Build-nightly: | ||
needs: check_date | ||
if: ${{ needs.check_date.outputs.should_run != 'false' }} | ||
runs-on: ubuntu-latest | ||
env: | ||
DEMO_KEY_PASSWORD: ${{ secrets.DEMO_KEY_PASSWORD }} | ||
USERNAME: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags | ||
- name: VERSION_NAME from inputs | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
run: | | ||
echo "VERSION_NAME=${{ inputs.version_name }}" >> "$GITHUB_ENV" | ||
- name: Find latest tag | ||
if: ${{ github.event_name != 'workflow_dispatch' }} | ||
id: previoustag | ||
uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
with: | ||
fallback: 0.0.1-alpha01 # Optional fallback tag to use when no tag can be found | ||
- name: Setup VERSION_NAME from latest git tag | ||
if: ${{ github.event_name != 'workflow_dispatch' }} | ||
run: | | ||
echo "VERSION_NAME=${{ steps.previoustag.outputs.tag }}" >> "$GITHUB_ENV" | ||
- name: Print VersionName | ||
run: | | ||
echo "Version name is ${{ env.VERSION_NAME }}" | ||
echo "ref ${GITHUB_REF}" | ||
echo "refname ${GITHUB_REF_NAME}" | ||
echo "refname ${GITHUB_REF_TYPE}" | ||
echo "CI ${{ env.CI }}" | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
- name: Build with Gradle | ||
uses: gradle/[email protected] | ||
with: | ||
arguments: assembleNightlyRelease | ||
- name: upload artifact to Firebase App Distribution | ||
uses: wzieba/Firebase-Distribution-Github-Action@v1 | ||
with: | ||
appId: ${{ secrets.NIGHTLY_APP_ID }} | ||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }} | ||
groups: ${{ secrets.NIGHTLY_GROUPS }} | ||
file: pillarbox-demo/build/outputs/apk/nightly/release/pillarbox-demo-nightly-release.apk | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,59 @@ | ||
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.DEMO_KEY_PASSWORD }} | ||
USERNAME: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
VERSION_NAME: ${{ github.ref_name }} | ||
|
||
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: Print release tag | ||
run: | | ||
echo "tag = ${GITHUB_REF_NAME}" | ||
echo "version_name = ${VERSION_NAME}" | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' | ||
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: publish | ||
- 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.RELEASE_APP_ID }} | ||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }} | ||
groups: ${{ secrets.RELEASE_GROUPS }} | ||
file: pillarbox-demo/build/outputs/apk/prod/release/pillarbox-demo-prod-release.apk | ||
- name: Create Github release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
draft: true | ||
prerelease: steps.check-tag.outputs.prerelease == 'true' | ||
skipIfReleaseExists: true | ||
generateReleaseNotes: true |
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
Oops, something went wrong.