-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Pulling in action definitions
1 parent
815c036
commit 349df9d
Showing
3 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
.github/workflows/pyinstaller-linux-amd64-release-azure.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Linux amd64 Release Build - Azure Enabled | ||
|
||
on: | ||
push: | ||
branches: | ||
- release-azure | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.11' # Specify the Python version you need | ||
|
||
- name: Install wx | ||
run: pip install https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04/wxPython-4.2.1-cp311-cp311-linux_x86_64.whl | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Install PyInstaller | ||
run: pip install pyinstaller | ||
|
||
- name: Build Executable | ||
run: pyinstaller --clean main.spec --distpath ./dist/linux_amd64/ | ||
|
||
- name: Move in support data files for runtime | ||
run: cp unknown_badge.png dist/linux_amd64/ | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tritime-linux-amd64 | ||
path: dist/linux_amd64/ | ||
|
||
- name: Cache Build Output | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./dist/linux_amd64/ | ||
key: linux-amd64-app-build-azure-${{ github.ref_name }}-${{ github.sha }} | ||
enableCrossOsArchive: true | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
name: Create Release - Azure Enabled | ||
|
||
on: | ||
push: | ||
branches: [ azure-release ] | ||
pull_request: | ||
branches: [ azure-release ] | ||
|
||
jobs: | ||
release: | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
runs-on: ubuntu-latest # You can specify other OS like windows-latest if needed | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get the latest tag | ||
id: get_tag | ||
run: | | ||
latest_tag=$(git describe --tags --abbrev=0) | ||
echo "Latest tag: $latest_tag" | ||
# Extract version number (assuming tags follow semantic versioning) | ||
if [ -z "$latest_tag" ]; then | ||
echo "::set-output name=new_tag::v1.0.0" | ||
else | ||
major=$(echo $latest_tag | cut -d. -f1 | sed 's/v//') | ||
minor=$(echo $latest_tag | cut -d. -f2) | ||
patch=$(echo $latest_tag | cut -d. -f3) | ||
new_patch=$((patch + 1)) | ||
new_tag="v$major.$minor.$new_patch" | ||
echo "::set-output name=new_tag::$new_tag" | ||
fi | ||
shell: bash | ||
|
||
- name: Wait for Caches to Appear | ||
id: wait-for-cache | ||
run: | | ||
max_attempts=40 # Maximum number of attempts | ||
attempt=1 | ||
success=false | ||
while [ $attempt -le $max_attempts ]; do | ||
echo "Attempt $attempt: Checking for all caches..." | ||
# Check for all caches | ||
windows_cache=$(gh cache list --json key --jq ".[] | select(.key == \"windows-app-build-${{ github.ref_name }}-${{ github.sha }}\")") | ||
linux_cache=$(gh cache list --json key --jq ".[] | select(.key == \"linux-amd64-app-build-${{ github.ref_name }}-${{ github.sha }}\")") | ||
if [ -n "$windows_cache" ]; then | ||
echo "Windows cache found." | ||
fi | ||
if [ -n "$linux_cache" ]; then | ||
echo "Linux amd64 cache found." | ||
fi | ||
if [ -n "$windows_cache" ] && [ -n "$linux_cache" ]; then | ||
echo "All caches found! Proceeding with build." | ||
success=true | ||
break | ||
else | ||
echo "One or more caches not found. Retrying in 30 seconds..." | ||
sleep 30 | ||
fi | ||
attempt=$(( attempt + 1 )) | ||
done | ||
if [ "$success" = false ]; then | ||
echo "Caches not available after $max_attempts attempts. Exiting..." | ||
exit 1 | ||
fi | ||
- name: Restore Windows x64 From Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./dist/windows/ | ||
key: windows-app-build-azure-${{ github.ref_name }}-${{ github.sha }} | ||
enableCrossOsArchive: true | ||
fail-on-cache-miss: true | ||
|
||
- name: Restore Linux amd64 From Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./dist/linux_amd64/ | ||
key: linux-amd64-app-build-azure-${{ github.ref_name }}-${{ github.sha }} | ||
enableCrossOsArchive: true | ||
fail-on-cache-miss: true | ||
|
||
- name: Verify Restored Binaries | ||
run: | | ||
echo "Listing files in ./:" | ||
ls -l ./ | ||
ls -l ./dist/linux_amd64/ | ||
ls -l ./dist/windows/ | ||
- name: Create Windows ZIP archive | ||
run: | | ||
zip -jr ./tritime-win64.zip ./dist/windows/ | ||
- name: Create Linux amd64 archive | ||
run: | | ||
cd dist/linux_amd64/ && tar -czvf ../../tritime-linux-amd64.tar.gz ./ | ||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.get_tag.outputs.new_tag }} | ||
release_name: Tritime (Azure) ${{ steps.get_tag.outputs.new_tag }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Windows Artifact to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./tritime-win64.zip | ||
asset_name: tritime-win64.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Upload Linux amd64 Artifact to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./tritime-linux-amd64.tar.gz | ||
asset_name: tritime-linux-amd64.tar.gz | ||
asset_content_type: application/tgz | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Windows x64 Release Build | ||
|
||
on: | ||
push: | ||
branches: [ azure-release ] | ||
pull_request: | ||
branches: [ azure-release ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Package Application | ||
uses: JackMcKew/pyinstaller-action-windows@main | ||
with: | ||
path: ./ | ||
|
||
- name: Move in support data files for runtime | ||
run: cp unknown_badge.png dist/windows/ | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: tritime-win64 | ||
path: ./dist/windows | ||
|
||
- name: Cache Build Output | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./dist/windows/ | ||
key: windows-app-build-azure-${{ github.ref_name }}-${{ github.sha }} | ||
enableCrossOsArchive: true |