Publish Release #23
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
name: Publish Release | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.target || 'all' }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
pull-requests: write | |
on: | |
workflow_dispatch: | |
inputs: | |
new_version: | |
description: 'Provide the version for this release' | |
required: true | |
type: string | |
prev_tag: | |
description: 'The tag to compare the changelog to' | |
required: false | |
type: string | |
target: | |
description: 'Build only Target' | |
required: true | |
default: 'all' | |
type: choice | |
options: | |
- all | |
- ios | |
- android | |
- macos | |
- linux | |
- windows-exe | |
- windows-msix | |
custom_title: | |
description: 'You want a custom title for the release?' | |
required: false | |
type: string | |
schedule: | |
- cron: 0 1 * * 4 | |
jobs: | |
run_checker: | |
runs-on: ubuntu-latest | |
name: Check latest commit | |
outputs: | |
should_run: ${{ inputs.new_version != null || steps.check-new-commits.outputs.has-new-commits }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # fetch all history and tags | |
- name: Check for new commits since last release | |
id: check-new-commits | |
shell: bash | |
run: | | |
if [ `git diff --name-only ${{ inputs.prev_tag || 'release-latest' }} -- app native .changes | wc -l` -ne 0 ]; then | |
echo "has-new-commits=true" >> $GITHUB_OUTPUT ; | |
else | |
echo "has-new-commits=false" >> $GITHUB_OUTPUT ; | |
fi | |
tags: | |
runs-on: ubuntu-latest | |
needs: | |
- run_checker | |
if: ${{ needs.run_checker.outputs.should_run != 'false' }} | |
# Map a step output to a job output | |
outputs: | |
tag: v${{ inputs.new_version || steps.version.outputs.version }} | |
version: ${{ inputs.new_version || steps.version.outputs.version }} | |
build_num: ${{ steps.build_num.outputs.build_num }} | |
targets: ${{ inputs.target || 'all' }} | |
release_title_prefix: ${{ inputs.custom_title || 'Release'}} | |
steps: | |
- id: version | |
# the suffix 0 allows us to provide up to 9 more hotfixes on the same day | |
run: echo "version=`date +1.%y.%-m%d0`" >> $GITHUB_OUTPUT | |
- id: build_num | |
run: echo "build_num=`date +%s`" >> $GITHUB_OUTPUT | |
build: | |
uses: ./.github/workflows/build-app.yml | |
needs: | |
- tags | |
with: | |
build_num: ${{ needs.tags.outputs.build_num }} | |
version: ${{ needs.tags.outputs.version }} | |
release_title: "${{ needs.tags.outputs.release_title_prefix }} ${{ needs.tags.outputs.tag }}" | |
release_tag: ${{ needs.tags.outputs.tag }} | |
targets: ${{ needs.tags.outputs.targets }} | |
release: true | |
release_env: 'release' | |
secrets: inherit | |
changelog: | |
uses: ./.github/workflows/build-changelog.yml | |
needs: | |
- tags | |
secrets: inherit | |
## ## ###### ###### ######## ####### ######## ######## | |
### ### ## ## ## ## ## ## ## ## ## ## | |
#### #### ## ## ## ## ## ## ## ## | |
## ### ## ###### ###### ## ## ## ######## ###### | |
## ## ## ## ## ## ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ###### ###### ## ####### ## ## ######## | |
microsoft-store: | |
runs-on: windows-latest | |
environment: release | |
needs: | |
- tags | |
- build | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Windows msix | |
- name: Create Archive | |
run: | | |
Rename-Item -Path acter-windows-${{ needs.tags.outputs.version }}.msix -NewName acter.msix | |
Compress-Archive -Path acter.msix acter.zip | |
- name: setup storebroker | |
run: | | |
Install-Module StoreBroker -Force | |
Import-Module StoreBroker | |
# do the submission | |
- name: submit to MSStore via StoreBroker | |
env: | |
TENANTID: ${{ secrets.AZURE_AD_TENANT_ID }} | |
CLIENTID: ${{ secrets.AZURE_AD_CLIENT_ID }} | |
CLIENTSECRET: ${{ secrets.AZURE_AD_CLIENT_SECRET }} | |
MS_STORE_APP_ID: ${{ secrets.MS_STORE_APP_ID }} | |
run: | | |
$DebugPreference = 'Continue' | |
# prepare te package | |
Write-Debug "Logging in" | |
# login with the StoreBroker | |
$sec = ConvertTo-SecureString $env:CLIENTSECRET -AsPlainText -Force | |
$cred = New-Object System.Management.Automation.PSCredential $env:CLIENTID, $sec | |
Set-StoreBrokerAuthentication -TenantId $env:TENANTID -Credential $cred -Verbose | |
Write-Debug "Logged in. Preparing submission" | |
# create the submission and add new package | |
$sub = New-ApplicationSubmission -AppId $env:MS_STORE_APP_ID -Force -Verbose | |
$sub.applicationPackages | ForEach-Object { $_.fileStatus = "PendingDelete" } | |
$pkg = $sub.applicationPackages[0].PSObject.Copy() | |
$pkg.fileName = "acter.msix" | |
$pkg.fileStatus = "PendingUpload" | |
$pkg.PSObject.Properties.Remove("version") | |
$pkg.PSObject.Properties.Remove("id") | |
$sub.applicationPackages += $pkg | |
Write-Debug "Setting Submission ID" | |
Set-ApplicationSubmission -AppId $env:MS_STORE_APP_ID -UpdatedSubmission $sub | |
Write-Debug "Setting Submission Package" | |
Set-SubmissionPackage -PackagePath 'acter.zip' -UploadUrl ($sub.fileUploadUrl) | |
Write-Debug "Completing submission" | |
Complete-ApplicationSubmission -AppId $env:MS_STORE_APP_ID -SubmissionId ($sub.id) | |
Write-Debug "Submitted successfully" | |
######## ## ### ## ## ###### ######## ####### ######## ######## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ## ## ## #### ## ## ## ## ## ## ## | |
######## ## ## ## ## ###### ## ## ## ######## ###### | |
## ## ######### ## ## ## ## ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ######## ## ## ## ###### ## ####### ## ## ######## | |
google-play-store: | |
runs-on: ubuntu-latest | |
environment: release | |
needs: | |
- tags | |
- build | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Android | |
# - uses: actions/download-artifact@v4 | |
# with: | |
# name: Android-debug-symbols | |
- name: Release Build to playstore | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_ACCOUNT_KEY }} | |
packageName: global.acter.a3 | |
releaseName: ${{ needs.tags.outputs.tag }} | |
releaseFiles: app-release.aab | |
# debugSymbols: "*.symbols" | |
track: beta | |
status: completed | |
#### ####### ###### ### ######## ######## ###### ######## ####### ######## ######## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ## ###### ## ## ######## ######## ###### ## ## ## ######## ###### | |
## ## ## ## ######### ## ## ## ## ## ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
#### ####### ###### ## ## ## ## ###### ## ####### ## ## ######## | |
apple-store-ios: | |
runs-on: macos-latest | |
environment: release | |
needs: | |
- tags | |
- changelog | |
- build | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: iOS | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Changelog | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
architecture: x64 | |
- run: pip3 install codemagic-cli-tools | |
- name: Install App Store Connect Auth | |
env: | |
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }} | |
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
run: | | |
mkdir private_keys | |
echo -n "$APPLE_API_KEY_BASE64" | base64 --decode --output "private_keys/AuthKey_$APPLE_API_KEY_ID.p8" | |
ls -ltas private_keys | |
- name: Publish to AppStore | |
env: | |
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.APPLE_API_KEY_ID }} | |
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }} | |
shell: bash | |
run: | | |
app-store-connect publish --verbose --app-store --expire-build-submitted-for-review --platform=IOS --whats-new @file:CHANGELOG.md --path=*.ipa | |
- name: Clean up keychain and provisioning profile | |
if: ${{ always() }} | |
run: | | |
rm -rf private_keys | |
## ## ### ###### ### ######## ######## ###### ######## ####### ######## ######## | |
### ### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
#### #### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ### ## ## ## ## ## ## ######## ######## ###### ## ## ## ######## ###### | |
## ## ######### ## ######### ## ## ## ## ## ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ## ## ###### ## ## ## ## ###### ## ####### ## ## ######## | |
apple-store-mac: | |
runs-on: macos-latest | |
environment: release | |
needs: | |
- tags | |
- build | |
- changelog | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: MacOS | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Changelog | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
architecture: x64 | |
- run: pip3 install codemagic-cli-tools | |
- name: Install App Store Connect Auth | |
env: | |
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }} | |
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
run: | | |
mkdir private_keys | |
echo -n "$APPLE_API_KEY_BASE64" | base64 --decode --output "private_keys/AuthKey_$APPLE_API_KEY_ID.p8" | |
ls -ltas private_keys | |
- name: Publish to AppStore | |
env: | |
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.APPLE_API_KEY_ID }} | |
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }} | |
shell: bash | |
run: | | |
app-store-connect publish --verbose --app-store --expire-build-submitted-for-review --platform=MAC_OS --whats-new @file:CHANGELOG.md --path=*.pkg | |
- name: Clean up keychain and provisioning profile | |
if: ${{ always() }} | |
run: | | |
rm -rf private_keys | |
### ######## ###### ## ## ### ## ## ######## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ######## ## ######### ## ## ## ## ######## | |
######### ## ## ## ## ## ######### ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ## ## ###### ## ## ## ## ####### ## ## | |
publish_aur: | |
environment: release | |
needs: | |
- tags | |
- build | |
name: Publish AUR | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Linux x64 | |
- name: Create PKGBUILD file | |
run: | | |
cp app/linux/packaging/aur/PKGBUILD PKGBUILD | |
VERSION=${{ needs.tags.outputs.version }} | |
DOWNLOAD_PATH='v${{ needs.tags.outputs.version }}\/acter-linux-x64-${{ needs.tags.outputs.version }}.tar.bz2' | |
MD5SUM=`md5sum acter-linux-x64-$VERSION.tar.bz2 | awk '{print $1}'` | |
echo "Version: $VERSION" | |
echo "Download Path: $DOWNLOAD_PATH" | |
echo "MD5Sum: $MD5SUM" | |
sed -i "s/%{{PKGNAME}}%/acter-bin/g" PKGBUILD | |
sed -i "s/%{{PKGNAME_CONFLICTS}}%/acter-nightly-bin/g" PKGBUILD | |
sed -i "s/%{{VERSION}}%/$VERSION/g" PKGBUILD | |
sed -i "s/%{{DOWNLOAD_PATH}}%/$DOWNLOAD_PATH/g" PKGBUILD | |
sed -i "s/%{{LINUX_MD5}}%/$MD5SUM/g" PKGBUILD | |
echo " --- Final PKGBUILD File " | |
cat PKGBUILD | |
- uses: KSXGitHub/[email protected] | |
name: Publish to AUR | |
with: | |
pkgname: acter-bin | |
pkgbuild: ./PKGBUILD | |
commit_username: Sari | |
commit_email: [email protected] | |
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
commit_message: Updated to ${{ needs.tags.outputs.version }} | |
publish_aur_nightly: | |
environment: release | |
needs: | |
- tags | |
- build | |
name: Publish AUR nightly | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Linux x64 | |
- name: Patch PKGBUILD file | |
run: | | |
cp app/linux/packaging/aur/PKGBUILD PKGBUILD | |
VERSION=${{ needs.tags.outputs.version }} | |
DOWNLOAD_PATH='v${{ needs.tags.outputs.version }}\/acter-linux-x64-${{ needs.tags.outputs.version }}.tar.bz2' | |
MD5SUM=`md5sum acter-linux-x64-$VERSION.tar.bz2 | awk '{print $1}'` | |
echo "Version: $VERSION" | |
echo "Download Path: $DOWNLOAD_PATH" | |
echo "MD5Sum: $MD5SUM" | |
sed -i "s/%{{PKGNAME}}%/acter-nightly-bin/g" PKGBUILD | |
sed -i "s/%{{PKGNAME_CONFLICTS}}%/acter-bin/g" PKGBUILD | |
sed -i "s/%{{VERSION}}%/$VERSION/g" PKGBUILD | |
sed -i "s/%{{DOWNLOAD_PATH}}%/$DOWNLOAD_PATH/g" PKGBUILD | |
sed -i "s/%{{LINUX_MD5}}%/$MD5SUM/g" PKGBUILD | |
echo " --- Final PKGBUILD File " | |
cat PKGBUILD | |
- uses: KSXGitHub/[email protected] | |
name: Publish to AUR | |
with: | |
pkgname: acter-nightly-bin | |
pkgbuild: ./PKGBUILD | |
commit_username: Sari | |
commit_email: [email protected] | |
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
commit_message: Updated to ${{ needs.tags.outputs.tag }} | |
###### #### ######## ## ## ## ## ######## ######## ## ## ######## ## #### ###### ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## #### ## ## ######### ## ## ######## ######## ## ## ######## ## ## ###### ######### | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## | |
###### #### ## ## ## ####### ######## ## ####### ######## ######## #### ###### ## ## | |
publish: | |
environment: release | |
runs-on: ubuntu-latest | |
name: Publish | |
# if: ${{ github.event.schedule }} | |
needs: | |
- tags | |
- build | |
- changelog | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Changelog | |
- name: Configure git | |
run: | # make sure we have the tags and all | |
git fetch --prune --unshallow --tags | |
git config --global user.name 'Sari' | |
git config --global user.email '[email protected]' | |
- name: Clear old docs | |
continue-on-error: true | |
run: | | |
git rm --ignore-unmatch .changes/*.md | |
- name: Tag for release | |
run: | | |
echo "Add release ${{ needs.tags.outputs.tag }}" | |
git checkout -b ci/release-${{ needs.tags.outputs.tag }} | |
git commit -m "Releasing ${{ needs.tags.outputs.tag }}" | |
git tag ${{ needs.tags.outputs.tag }} | |
git push origin ci/release-${{ needs.tags.outputs.tag }} ${{ needs.tags.outputs.tag }} | |
- name: Create Pull Request | |
id: cpr | |
run: | | |
gh pr create -B main -H ci/release-$TAG --title "Releasing $TAG" --body "Release $TAG auto PR." -a gnunicorn -l minor | |
gh pr merge --auto --merge --delete-branch ci/release-$TAG | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: ${{ needs.tags.outputs.tag }} | |
- name: Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
# publish this full release now | |
draft: true | |
generate_release_notes: false | |
name: "${{ needs.tags.outputs.release_title_prefix }} ${{ needs.tags.outputs.tag }}" | |
tag_name: ${{ needs.tags.outputs.tag }} | |
# body_path: CHANGELOG.md | |
prerelease: false | |
files: CHANGELOG.md | |
- uses: eregon/publish-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} |