Skip to content

Commit

Permalink
Add push binaries to S3 step for desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Jan 28, 2025
1 parent 6b2b9a6 commit b20e43f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 12 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,18 @@ jobs:
fileDir: './android/app'
encodedString: ${{ secrets.KEYSTORE }}


- name: Decode APP_ENV and write to app.env
- name: Generate app.env
env:
ANDROID_INTERSTITIAL_AD_ID: ${{ secrets.INTERSTITIAL_AD_UNIT_ID }}
IOS_INTERSTITIAL_AD_ID: ${{ secrets.INTERSTITIAL_AD_UNIT_ID_IOS }}
TAPSELL_VIDEO_INTERSTITIAL_ZONE_ID: ${{ secrets.TAPSELL_VIDEO_INTERSTITIAL_ZONE_ID }}
TAPSELL_INTERSTITIAL_ZONE_ID: ${{ secrets.TAPSELL_INTERSTITIAL_ZONE_ID }}
run: |
echo "${{ secrets.APP_ENV }}" | base64 --decode > app.env
echo "File 'app.env' created."
ls -lh app.env
touch app.env
echo "Android_interstitialAd=$ANDROID_INTERSTITIAL_AD_ID" > app.env
echo "IOS_interstitialAd=$IOS_INTERSTITIAL_AD_ID" >> app.env
echo "VideoInterstitialZoneId=$TAPSELL_VIDEO_INTERSTITIAL_ZONE_ID" >> app.env
echo "InterstitialZoneId=$TAPSELL_INTERSTITIAL_ZONE_ID" >> app.env
- name: Extract app version from pubspec.yaml
id: extract_version
Expand Down
47 changes: 40 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ jobs:
needs: [ determine-platform,set-version, build ]
env:
version: ${{ needs.set-version.outputs.version }}
version_file: ${{ needs.set-version.outputs.version_file }}
prefix: ${{ needs.set-version.outputs.prefix }}
platform: ${{ needs.determine-platform.outputs.platform }}
dist-suffix: x64
steps:
- name: Download the mac build output
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -206,6 +208,44 @@ jobs:
debugSymbols: debug-symbols.zip
mappingFile: mapping.txt

- name: Push binaries to S3
if: needs.determine-platform.outputs.platform == 'desktop' || needs.determine-platform.outputs.platform == 'all'
env:
macos_dist: "${{ env.prefix }}-${{ env.version }}.dmg"
windows_dist: "${{env.prefix}}-${{env.version}}-${{env.dist-suffix}}.exe"
windows_dist_versionless: "${{env.prefix}}-${{env.dist-suffix}}.exe"
windows_update: "lantern_update_windows_${{env.dist-suffix}}-${{env.version}}.bz2"
linux_dist_source: "${{env.prefix}}-${{env.dist-suffix}}.deb"
linux_dist: "${{env.prefix}}-${{env.version}}-64-bit.deb"
linux_dist_versionless: "${{env.prefix}}-64-bit.deb"
run: |
# macOS
mv lantern-installer.dmg ${{ env.macos_dist }}
cp ${{ env.macos_dist }} ${{ env.prefix }}.dmg
echo ${{ env.version }} > ${{ env.version_file }}
shasum -a 256 "$DMG" | cut -d " " -f 1 > "$DMG".sha256
cp "$DMG".sha256 ${{ env.prefix }}.dmg.sha256
s3cmd put --acl-public "$DMG" ${{ env.version_file }} "$DMG".sha256 ${{ env.prefix }}.dmg.sha256 ${{ env.prefix }}.dmg "s3://lantern"
# Windows
mv lantern-installer-x64.exe ${{ env.windows_dist }}
cp ${{ env.windows_dist }} ${{ env.windows_dist_versionless }}
shasum -a 256 ${{ env.windows_dist }} | cut -d " " -f 1 > ${{ env.windows_dist }}.sha256
cp ${{ env.windows_dist }}.sha256 ${{ env.windows_dist_versionless }}.sha256
s3cmd put --acl-public ${{ env.windows_dist }} ${{ env.windows_dist }}.sha256 ${{ env.windows_dist_versionless }}.sha256 ${{ env.windows_dist_versionless }} "s3://lantern"
# Linux
mv ${{ env.linux_dist_source }} ${{ env.linux_dist }}
cp ${{ env.linux_dist }} ${{ env.linux_dist_versionless }}
shasum -a 256 ${{ env.linux_dist }} | cut -d " " -f 1 > ${{ env.linux_dist }}.sha256
cp ${{ env.linux_dist }}.sha256 ${{ env.linux_dist_versionless }}.sha256
ls -l
s3cmd put --acl-public ${{ env.linux_dist }} ${{ env.linux_dist }}.sha256 ${{ env.linux_dist_versionless }}.sha256 ${{ env.linux_dist_versionless }} "s3://lantern"
- name: Grant private modules access
run: git config --global url."https://${{ secrets.CI_PRIVATE_REPOS_GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"

Expand Down Expand Up @@ -239,13 +279,6 @@ jobs:
if [[ "${{ env.platform }}" == "ios" || "${{ env.platform }}" == "all" ]]; then
shasum -a 256 ${{ env.prefix }}.ipa | cut -d " " -f 1 > ${{ env.prefix }}.ipa.sha256
fi
if [[ "${{ env.platform }}" == "desktop" || "${{ env.platform }}" == "all" ]]; then
shasum -a 256 ${{ env.prefix }}-mac.dmg | cut -d " " -f 1 > ${{ env.prefix }}-mac.dmg.sha256
shasum -a 256 ${{ env.prefix }}-mac_arm.dmg | cut -d " " -f 1 > ${{ env.prefix }}-mac_arm.dmg.sha256
shasum -a 256 ${{ env.prefix }}-x64.exe | cut -d " " -f 1 > ${{ env.prefix }}-x64.exe.sha256
shasum -a 256 ${{ env.prefix }}-64-bit.deb | cut -d " " -f 1 > ${{ env.prefix }}-64-bit.deb.sha256
fi
- name: Commit
run: |
Expand Down

0 comments on commit b20e43f

Please sign in to comment.