Skip to content

Commit

Permalink
feat(ci): update darwin sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
ventsislav-georgiev committed Dec 28, 2023
1 parent 10cb298 commit 8262027
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 111 deletions.
75 changes: 0 additions & 75 deletions .github/workflows/darwin-image.yml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/darwin-sdks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Darwin SDKs
on:
workflow_dispatch: ~

jobs:
extract_darwin_sdks:
name: Extract Darwin SDKs
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Cache fyne-cross
uses: actions/cache@v3
env:
cache-name: cache-fyne-cross
with:
path: ~/.cache/fyne-cross
key: ${{ runner.os }}-fyne-cross-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-fyne-cross-
- name: Cache xcode cli tools
id: xcode-cli-tools-cache
uses: actions/cache@v3
env:
cache-name: cache-cli_tools_15.1
with:
path: ~/.cache/xcode
key: ${{ runner.os }}-cli_tools_15.1
restore-keys: |
${{ runner.os }}-cli_tools_15.1
- name: Cache SDKs
id: sdks-cache
uses: actions/cache@v3
env:
cache-name: cache-sdks
with:
path: |
~/.cache/SDKs
key: ${{ runner.os }}-1.4-darwin-15.1
restore-keys: |
${{ runner.os }}-sdks-
- uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Install fyne-cross
run: |
go install fyne.io/fyne/v2/cmd/fyne@latest
go install github.com/fyne-io/fyne-cross@latest
- name: Get xcode cli tools
if: steps.xcode-cli-tools-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.cache/xcode
cd ~/.cache/xcode && wget -q -O Command_Line_Tools_for_Xcode_15.1.dmg ${{secrets.REMOTE_HOST}}/files/Command_Line_Tools_for_Xcode_15.1.dmg?token=${{secrets.SRV_TOKEN}}
- name: Install brew deps
run: |
brew install upx docker colima
- name: Start colima
id: start-colima
continue-on-error: true
run: |
colima start
- name: Extract SDKs
id: extract-sdks
continue-on-error: true
if: steps.sdks-cache.outputs.cache-hit != 'true' && steps.start-colima.outcome == 'success'
run: |
fyne-cross darwin-sdk-extract --xcode-path ~/.cache/xcode/Command_Line_Tools_for_Xcode_15.1.dmg --pull=false
cd ~/.cache/xcode/SDKs
tar -czf SDKs-1.4-darwin-15.1.tar.gz *
mkdir -p ~/.cache/SDKs
mv SDKs-1.4-darwin-15.1.tar.gz ~/.cache/SDKs
rm -rf ~/.cache/xcode/SDKs
- name: Send image
if: steps.sdks-cache.outputs.cache-hit == 'true' || steps.extract-sdks.outcome == 'success'
run: |
cd ~/.cache/SDKs && curl [email protected] ${{secrets.REMOTE_HOST}}/upload?token=${{secrets.SRV_TOKEN}}
69 changes: 33 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v1

build_artifacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: cache docker
id: docker-cache
uses: actions/cache@v1
- name: Cache SDKs
id: sdks-cache
uses: actions/cache@v3
env:
cache-name: cache-docker
cache-name: cache-sdks
with:
path: |
~/.cache/docker
key: ${{ runner.os }}-docker-v1-cli_tools_13.2
~/.cache/SDKs
key: ${{ runner.os }}-1.4-darwin-15.1
restore-keys: |
${{ runner.os }}-docker-
${{ runner.os }}-sdks-
- name: cache go dependencies
- name: Cache go dependencies
id: go-deps
uses: actions/cache@v1
uses: actions/cache@v3
env:
cache-name: cache-go-deps
with:
Expand All @@ -48,8 +48,8 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: cache go build artifacts
uses: actions/cache@v1
- name: Cache go build artifacts
uses: actions/cache@v3
env:
cache-name: cache-go-artifacts
with:
Expand All @@ -58,8 +58,8 @@ jobs:
restore-keys: |
${{ runner.os }}-go-artifacts-
- name: cache fyne-cross
uses: actions/cache@v1
- name: Cache fyne-cross
uses: actions/cache@v3
env:
cache-name: cache-fyne-cross
with:
Expand All @@ -68,51 +68,48 @@ jobs:
restore-keys: |
${{ runner.os }}-fyne-cross-
- name: get darwin image
if: steps.docker-cache.outputs.cache-hit != 'true'
- name: Get Darwin SDKs
if: steps.sdks-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.cache/docker
cd ~/.cache/docker && wget -q -O fyne-cross-1.1-darwin.tar.gz ${{secrets.REMOTE_HOST}}/files/fyne-cross-1.1-darwin.tar.gz?token=${{secrets.SRV_TOKEN}}
cd ~/.cache/docker && docker load < fyne-cross-1.1-darwin.tar.gz
mkdir -p ~/.cache/SDKs
cd ~/.cache/SDKs
wget -q -O SDKs-1.4-darwin-15.1.tar.gz ${{secrets.REMOTE_HOST}}/files/SDKs-1.4-darwin-15.1.tar.gz?token=${{secrets.SRV_TOKEN}}
tar -xzf SDKs-1.4-darwin-15.1.tar.gz
rm SDKs-1.4-darwin-15.1.tar.gz
- name: load darwin image
if: steps.docker-cache.outputs.cache-hit == 'true'
run: |
cd ~/.cache/docker && docker load < fyne-cross-1.1-darwin.tar.gz
- name: get fyne-cross
- name: Get fyne-cross
if: steps.go-deps.outputs.cache-hit != 'true'
run: |
go install github.com/fyne-io/fyne-cross@v1.1.3
go install github.com/fyne-io/fyne-cross@v1.4.3
- name: get upx
- name: Get upx
run: |
sudo apt update
sudo apt install upx-ucl
- name: build
- name: Build
run: |
tag=$(echo ${GITHUB_REF/refs\/tags\/v/})
if [ ${#tag} -lt 7 ]; then export APP_VER=${tag}; fi
echo "building v${APP_VER}"
fyne-cross darwin -arch=amd64,arm64 -name=Prosper -app-id=com.ventsislav-georgiev.prosper -app-version="${APP_VER}"
fyne-cross darwin -arch=amd64,arm64 -name=Prosper -app-id=com.ventsislav-georgiev.prosper -app-version="${APP_VER}" --macosx-sdk-path ~/.cache/SDKs/MacOSX12.3.sdk
fyne-cross linux -arch=amd64,arm64 -name=Prosper -app-id=com.ventsislav-georgiev.prosper -app-version="${APP_VER}" -release
fyne-cross windows -arch=amd64 -name=Prosper -app-id=com.ventsislav-georgiev.prosper -app-version="${APP_VER}"
- name: list binaries
- name: List binaries
run: |
find fyne-cross
- name: decrease distribution size
- name: Decrease distribution size
run: |
cp fyne-cross/dist/darwin-amd64/Prosper.app/Contents/MacOS/Prosper fyne-cross/bin/darwin-amd64/bin-darwin-amd64
cp fyne-cross/dist/darwin-arm64/Prosper.app/Contents/MacOS/Prosper fyne-cross/bin/darwin-arm64/bin-darwin-arm64
upx fyne-cross/bin/darwin-*/*
upx fyne-cross/bin/linux-*/*
upx fyne-cross/bin/windows-*/*
- name: prepare release artifacts
- name: Prepare release artifacts
run: |
gzip fyne-cross/bin/darwin-amd64/bin-darwin-amd64
gzip fyne-cross/bin/darwin-arm64/bin-darwin-arm64
Expand All @@ -127,11 +124,11 @@ jobs:
mv fyne-cross/bin/windows-amd64/Prosper fyne-cross/bin/windows-amd64/Prosper.exe && gzip fyne-cross/bin/windows-amd64/Prosper.exe && mv fyne-cross/bin/windows-amd64/Prosper.exe.gz fyne-cross/bin/windows-amd64/bin-windows-amd64.gz
mv fyne-cross/dist/windows-amd64/Prosper.zip fyne-cross/dist/windows-amd64/Prosper-windows-amd64.zip
- name: list all
- name: List all
run: |
find fyne-cross
- name: release
- name: Release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
Expand Down

0 comments on commit 8262027

Please sign in to comment.