Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from ThePieMonster/ThePieMonster-Workflow
Browse files Browse the repository at this point in the history
Update Workflow
  • Loading branch information
ThePieMonster authored Mar 17, 2022
2 parents 567609e + 3eba13c commit 200277e
Showing 1 changed file with 50 additions and 49 deletions.
99 changes: 50 additions & 49 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
echo "$LATESTRELEASETAG"
echo "LATESTRELEASETAG=$LATESTRELEASETAG" >> $GITHUB_ENV
- name: Create Latest Release TXT File
working-directory : ${{ github.workspace }}/app
run : |
echo "Create Latest Release TXT File"
echo "${{ env.LATESTRELEASETAG }}" > LatestReleaseTag.txt
- name: Get Gradle VersionName
working-directory : ${{ github.workspace }}/app
run : |
Expand All @@ -66,7 +72,7 @@ jobs:
echo "Create Gradle VersionName TXT File"
echo "${{ env.VERSIONNAME }}" > VersionName.txt
- name: Check If Current Tag Equals Latest Release
- name: Check If Gradle Version Equals Latest Release Tag
working-directory : ${{ github.workspace }}/app
run : |
VERSIONNAME=${{ env.VERSIONNAME }}
Expand All @@ -75,30 +81,30 @@ jobs:
echo "Latest Release Tag: $LATESTRELEASETAG"
if [ "$VERSIONNAME" = "$LATESTRELEASETAG" ]; then echo "Current Gradle Version is the same as GitHubs latest Release tag. This is a tagging conflict and can be resolved by updating the build.gradle file."; exit 1; else echo "All clear!"; fi
- name: Check If Current Tag Already Exists
uses: mukunku/[email protected]
id: checkTag
with:
tag: ${{ env.VERSIONNAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Output Tag Check
run: |
echo "Tag Check: ${{ steps.checkTag.outputs.exists }}"
echo "TAGCHECK=${{ steps.checkTag.outputs.exists }}" >> $GITHUB_ENV
- name: Create Tag
if: env.TAGCHECK == format('false')
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ env.VERSIONNAME }}',
sha: context.sha
})
# - name: Check If Current Tag Already Exists
# uses: mukunku/[email protected]
# id: checkTag
# with:
# tag: ${{ env.VERSIONNAME }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Output Tag Check
# run: |
# echo "Tag Check: ${{ steps.checkTag.outputs.exists }}"
# echo "TAGCHECK=${{ steps.checkTag.outputs.exists }}" >> $GITHUB_ENV
#
# - name: Create Tag
# if: env.TAGCHECK == format('false')
# uses: actions/github-script@v5
# with:
# script: |
# github.rest.git.createRef({
# owner: context.repo.owner,
# repo: context.repo.repo,
# ref: 'refs/tags/${{ env.VERSIONNAME }}',
# sha: context.sha
# })

- name: Decode Keystore
id: decode_keystore
Expand Down Expand Up @@ -153,11 +159,11 @@ jobs:
name: VersionName.txt
path: ${{ github.workspace }}/app/VersionName.txt

- name: Upload Artifact Changelog
uses: actions/upload-artifact@v2
with:
name: Changelog.txt
path: ${{ github.workspace }}/app/Changelog.txt
# - name: Upload Artifact Changelog
# uses: actions/upload-artifact@v2
# with:
# name: Changelog.txt
# path: ${{ github.workspace }}/app/Changelog.txt

merge_completed:
needs: build
Expand Down Expand Up @@ -194,27 +200,22 @@ jobs:
echo "Read Gradle VersionName"
echo "VERSIONNAME=$(cat VersionName.txt)" >> $GITHUB_ENV
- name: Output Gradle VersionName
run : |
echo "Output Gradle VersionName"
echo "${{ env.VERSIONNAME }}"
- name: Download Artifact Changelog
uses: actions/[email protected]
with:
name: Changelog.txt
path: ${{ github.workspace }}/artifact
# - name: Download Artifact Changelog
# uses: actions/[email protected]
# with:
# name: Changelog.txt
# path: ${{ github.workspace }}/artifact

- name: Read Changelog
working-directory : ${{ github.workspace }}/artifact
run : |
echo "Read Changelog"
echo "CHANGELOG=$(cat Changelog.txt)" >> $GITHUB_ENV
# - name: Read Changelog
# working-directory : ${{ github.workspace }}/artifact
# run : |
# echo "Read Changelog"
# echo "CHANGELOG=$(cat Changelog.txt)" >> $GITHUB_ENV

- name: Output Changelog
run : |
echo "Output Changelog"
echo "${{ env.CHANGELOG }}"
# - name: Output Changelog
# run : |
# echo "Output Changelog"
# echo "${{ env.CHANGELOG }}"

- name: Download Artifact APK
uses: actions/[email protected]
Expand Down

0 comments on commit 200277e

Please sign in to comment.