Skip to content

Commit 76ca3ea

Browse files
authored
chore(cicd): add 'latest' release (#56)
* chore(cicd): add 'latest' release * chore(version): bump commit hash
1 parent 0f4e537 commit 76ca3ea

5 files changed

Lines changed: 48 additions & 16 deletions

File tree

.github/scripts/buildAndroid.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ appVersionName=$(cat pubspec.yaml | grep "version: " | cut -d ' ' -f2 | cut -d '
33
appVersionCode=$(cat pubspec.yaml | grep "version: " | cut -d ' ' -f2 | cut -d '+' -f2)
44
fileType=".apk"
55
archiveName="SoundOnFire-v$appVersionName+$appVersionCode-$1$fileType"
6+
archiveNameLatest="SoundOnFire-latest.apk"
67
path="build/app/outputs/apk/release"
78

89
echo "Build .apk as artifact-type: $1 | $archiveName"
@@ -22,7 +23,10 @@ flutter build apk
2223
fileName=$path/$archiveName
2324

2425
# Rename artifact
26+
cp "$path/app-release.apk" "$path/$archiveNameLatest"
2527
mv -f "$path/app-release.apk" "$fileName"
2628
echo "Moved: $fileName"
2729
echo $fileName > tmp_artifact_path.txt
2830
echo $archiveName > tmp_artifact_name.txt
31+
echo "$path/$archiveNameLatest" > tmp_artifact_path_latest.txt
32+
echo $archiveNameLatest > tmp_artifact_name_latest.txt

.github/workflows/development.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ jobs:
5656
id: prepare-build
5757
run: |
5858
./.github/scripts/buildAndroid.sh beta "${{ secrets.KEYSTORE_PASSWORD }}" "${{ secrets.KEY_PASSWORD }}" "${{ secrets.KEY_ALIAS }}" "${{ secrets.APP_CENTER_SECRET }}"
59-
echo "::set-output name=dir::$(cat tmp_artifact_path.txt)"
60-
echo "::set-output name=file::$(cat tmp_artifact_name.txt)"
59+
echo "::set-output name=artifact-filepath::$(cat tmp_artifact_path.txt)"
60+
echo "::set-output name=artifact-filename::$(cat tmp_artifact_name.txt)"
6161
6262
- name: Upload artifact
6363
uses: actions/upload-artifact@v1
6464
with:
65-
name: ${{ steps.prepare-build.outputs.file }}
66-
path: ${{ steps.prepare-build.outputs.dir }}
65+
name: ${{ steps.prepare-build.outputs.artifact-filename }}
66+
path: ${{ steps.prepare-build.outputs.artifact-filepath }}

.github/workflows/release_trigger.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ jobs:
6262
id: prepare-build
6363
run: |
6464
./.github/scripts/buildAndroid.sh release "${{ secrets.KEYSTORE_PASSWORD }}" "${{ secrets.KEY_PASSWORD }}" "${{ secrets.KEY_ALIAS }}" "${{ secrets.APP_CENTER_SECRET }}"
65-
echo "::set-output name=dir::$(cat tmp_artifact_path.txt)"
66-
echo "::set-output name=file::$(cat tmp_artifact_name.txt)"
65+
echo "::set-output name=artifact-filepath::$(cat tmp_artifact_path.txt)"
66+
echo "::set-output name=artifact-filename::$(cat tmp_artifact_name.txt)"
67+
echo "::set-output name=artifact-filepath-latest::$(cat tmp_artifact_path_latest.txt)"
68+
echo "::set-output name=artifact-filename-latest::$(cat tmp_artifact_name_latest.txt)"
6769
6870
- name: Update In-App Update Config
6971
id: update-config
7072
run: |
71-
./.github/scripts/updateAppChangelog.sh ${{ steps.create_release.outputs.upload_url }}
73+
./.github/scripts/updateAppChangelog.sh ${{ steps.create-release-version.outputs.upload_url }}
7274
git add pubspec.yaml app-update-changelog.json CHANGELOG.md
7375
git commit -m "chore(version): update release output"
7476
git push
@@ -84,11 +86,14 @@ jobs:
8486
TAG="v$appVersionName+$appVersionCode"
8587
echo "::set-output name=name::$TAG"
8688
git push origin :refs/tags/${TAG}
89+
git push origin :refs/tags/latest
8790
git tag ${TAG}
91+
git tag latest
8892
git push origin ${TAG}
93+
git push origin latest
8994
90-
- name: Create Release
91-
id: create_release
95+
- name: Create Release Version
96+
id: create-release-version
9297
uses: actions/create-release@v1
9398
env:
9499
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -99,15 +104,37 @@ jobs:
99104
prerelease: false
100105
body: ${{ steps.semrel.outputs.changelog }}
101106

102-
- name: Upload Release Asset
103-
id: upload-release-asset
107+
- name: Upload Release Asset Version
108+
id: upload-release-asset-version
104109
uses: actions/upload-release-asset@v1
105110
env:
106111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107112
with:
108-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
109-
asset_path: ${{ steps.prepare-build.outputs.dir }}
110-
asset_name: ${{ steps.prepare-build.outputs.file }}
113+
upload_url: ${{ steps.create-release-version.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
114+
asset_path: ${{ steps.prepare-build.outputs.artifact-filepath }}
115+
asset_name: ${{ steps.prepare-build.outputs.artifact-filename }}
116+
asset_content_type: application/apk
117+
118+
- name: Create Release Latest
119+
id: create-release-latest
120+
uses: actions/create-release@v1
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
with:
124+
tag_name: latest
125+
release_name: Latest release
126+
draft: false
127+
prerelease: false
128+
129+
- name: Upload Release Asset Latest
130+
id: upload-release-asset-latest
131+
uses: actions/upload-release-asset@v1
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134+
with:
135+
upload_url: ${{ steps.create-release-latest.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
136+
asset_path: ${{ steps.prepare-build.outputs.artifact-filepath-latest }}
137+
asset_name: ${{ steps.prepare-build.outputs.artifact-filename-latest }}
111138
asset_content_type: application/apk
112139

113140
- name: Upload to App Center
@@ -116,4 +143,4 @@ jobs:
116143
appName: timo_knapp/SoundOnFire
117144
token: ${{secrets.APP_CENTER_API_TOKEN}}
118145
group: public
119-
file: ${{ steps.prepare-build.outputs.dir }}
146+
file: ${{ steps.prepare-build.outputs.artifact-filepath }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ In order to get started with **SoundOnFire** on your FireTV, you need to do the
3333
- [GitHub](https://github.com/timoknapp/sound-on-fire/releases)
3434
- [Microsoft App-Center](https://install.appcenter.ms/users/timo_knapp/apps/soundonfire/distribution_groups/public)
3535
- Install the `.apk` on your FireTV
36+
- (**easiest**) install [Downloader by AFTVnews](https://www.aftvnews.com/downloader/) on your FireTV, open it and enter `tinyurl.com/sof-release`, then read, understand and confirm the security prompts. (<small>You can also enter [**40787**](https://aftv.news/40787), but this requires an extra step to install the AFTVnews Downloader browser addon if you haven't already.</small>)
3637
- with your Android Smartphone using this [App](https://play.google.com/store/apps/details?id=mobi.koni.appstofiretv&hl=en)
3738
- with your computer or another FireTV App [read here](https://www.howtogeek.com/336602/how-to-sideload-apps-on-the-fire-tv-and-fire-tv-stick/)
3839
- Once the **SoundOnFire** App has been installed on your FireTV, a small modal will pop up on the bottom right of your screen. Otherwhise you will find the App under: `Home > Your Apps > All Apps > SoundOnFire`

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: A SoundCloud app for FireTV.
1111
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1212
# Read more about iOS versioning at
1313
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14-
version: 1.3.4+144
14+
version: 1.3.4+145
1515

1616
environment:
1717
sdk: ">=2.10.0 <3.0.0"

0 commit comments

Comments
 (0)