Skip to content

Nightly builds

Nightly builds #34

name: Nightly builds
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: 0 1 * * 0-3,5-6
permissions:
contents: write
jobs:
run_checker:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.check-new-commits.outputs.has-new-commits == 'true' && steps.check-changelog-files.outputs.has-changelog-files == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch the tags
- name: Check for new commits since last nightly
id: check-new-commits
shell: bash
run: |
if [ `git diff --name-only nightly-latest app native .changes | wc -l` -ne 0 ]; then
echo "has-new-commits=true" >> $GITHUB_OUTPUT ;
echo "has-new-commits=true";
else
echo "has-new-commits=false" >> $GITHUB_OUTPUT ;
echo "has-new-commits=false";
fi
- name: Check whether any changelog files are present
id: check-changelog-files
shell: bash
run: |
files=$(shopt -s nullglob;shopt -s dotglob;echo .changes/*.md)
if (( ${#files} ))
then
echo "has-changelog-files=true" >> $GITHUB_OUTPUT ;
echo "has-changelog-files=true";
else
echo "has-changelog-files=false" >> $GITHUB_OUTPUT ;
echo "has-changelog-files=false";
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: ${{ steps.tag.outputs.tag }}
version: ${{ steps.version.outputs.version }}
build_num: ${{ steps.build_num.outputs.build_num }}
prev_tag: 'nightly-latest'
steps:
- id: tag
run: echo "tag=`date +%F`" >> $GITHUB_OUTPUT
- id: build_num
run: echo "build_num=`date +%s`" >> $GITHUB_OUTPUT
- 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
build:
uses: ./.github/workflows/build-app.yml
needs:
- tags
with:
targets: android,linux,ios,macos,windows-exe # skip: windows-msix
artifacts_prefix: 'nightly-'
build_num: ${{ needs.tags.outputs.build_num }}
version: ${{ needs.tags.outputs.version }}
release_title: "Nightly ${{ needs.tags.outputs.tag }}"
release_tag: nightly-${{ needs.tags.outputs.tag }}
release_env: 'nightly'
release: true
prerelease: true
env_extra: "IS_NIGHTLY=true"
secrets: inherit
changelog:
uses: ./.github/workflows/build-changelog.yml
needs:
- tags
secrets: inherit
######## ## ### ## ## ###### ######## ####### ######## ######## ### ## ######## ## ## ###
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## #### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
######## ## ## ## ## ###### ## ## ## ######## ###### ####### ## ## ## ######## ######### ## ##
## ## ######### ## ## ## ## ## ## ## ## ######### ## ## ## ## #########
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ######## ## ## ## ###### ## ####### ## ## ######## ## ## ######## ## ## ## ## ##
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: alpha
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 Testflight
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 --testflight --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 Testflight
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 --testflight --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_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='nightly-${{ needs.tags.outputs.tag }}\/acter-nightly-linux-x64-${{ needs.tags.outputs.version }}.tar.bz2'
MD5SUM=`md5sum acter-nightly-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/github-actions-deploy-aur@v2.7.2
name: Publish to AUR
with:
pkgname: acter-nightly-bin
pkgbuild: ./PKGBUILD
commit_username: Sari
commit_email: sari@acter.global
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 'acter-sari@users.noreply.github.com'
- name: Tag for nightly release
run: |
git tag nightly-${{ needs.tags.outputs.tag }}
git tag -f nightly-latest
git push -f origin main nightly-${{ needs.tags.outputs.tag }} nightly-latest
- name: Release
id: create_release
uses: softprops/action-gh-release@v1
with:
# publish this nightly release now
draft: true
generate_release_notes: false
name: Nightly ${{ needs.tags.outputs.tag }}
tag_name: nightly-${{ needs.tags.outputs.tag }}
body_path: CHANGELOG.md
prerelease: true
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}