feat(ci): update darwin sdk #126
Workflow file for this run
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: Release | |
on: | |
push: | |
branches: [develop] | |
tags: | |
- "v*.*.*" | |
workflow_dispatch: ~ | |
env: | |
APP_VER: 0.0.0 | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21" | |
- 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-14.3.1 | |
restore-keys: | | |
${{ runner.os }}-sdks- | |
- name: Cache go dependencies | |
id: go-deps | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-go-deps | |
with: | |
path: ~/go | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Cache go build artifacts | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-go-artifacts | |
with: | |
path: ~/.cache/go-build | |
key: ${{ runner.os }}-go-artifacts-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-artifacts- | |
- 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: Get Darwin SDKs | |
if: steps.sdks-cache.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ~/.cache/SDKs | |
cd ~/.cache/SDKs | |
echo "Downloading SDKs" | |
wget -O SDKs-1.4-darwin-14.3.1.tar.gz --no-check-certificate ${{secrets.REMOTE_HOST}}/files/SDKs-1.4-darwin-14.3.1.tar.gz?token=${{secrets.SRV_TOKEN}} | |
echo "Extracting SDKs" | |
tar -xzf SDKs-1.4-darwin-14.3.1.tar.gz | |
rm SDKs-1.4-darwin-14.3.1.tar.gz | |
echo "Listing SDKs" | |
ls -la | |
- name: Install fyne-cross | |
if: steps.go-deps.outputs.cache-hit != 'true' | |
run: | | |
go install github.com/fyne-io/[email protected] | |
- name: Install upx | |
run: | | |
sudo apt update | |
sudo apt install upx-ucl | |
- 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}" --macosx-sdk-path ~/.cache/SDKs/MacOSX.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 | |
run: | | |
find fyne-cross | |
- 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 | |
run: | | |
gzip fyne-cross/bin/darwin-amd64/bin-darwin-amd64 | |
gzip fyne-cross/bin/darwin-arm64/bin-darwin-arm64 | |
cd fyne-cross/dist/darwin-amd64 && zip -r Prosper-darwin-amd64.zip Prosper.app && cd ../../.. | |
cd fyne-cross/dist/darwin-arm64 && zip -r Prosper-darwin-arm64.zip Prosper.app && cd ../../.. | |
gzip fyne-cross/bin/linux-amd64/Prosper && mv fyne-cross/bin/linux-amd64/Prosper.gz fyne-cross/bin/linux-amd64/bin-linux-amd64.gz | |
gzip fyne-cross/bin/linux-arm64/Prosper && mv fyne-cross/bin/linux-arm64/Prosper.gz fyne-cross/bin/linux-arm64/bin-linux-arm64.gz | |
mv fyne-cross/dist/linux-amd64/Prosper.tar.xz fyne-cross/dist/linux-amd64/Prosper-linux-amd64.tar.xz | |
mv fyne-cross/dist/linux-arm64/Prosper.tar.xz fyne-cross/dist/linux-arm64/Prosper-linux-arm64.tar.xz | |
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 | |
run: | | |
find fyne-cross | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
- name: Upload release artifacts | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
fyne-cross/bin/darwin-amd64/bin-darwin-amd64.gz | |
fyne-cross/bin/darwin-arm64/bin-darwin-arm64.gz | |
fyne-cross/dist/darwin-amd64/Prosper-darwin-amd64.zip | |
fyne-cross/dist/darwin-arm64/Prosper-darwin-arm64.zip | |
fyne-cross/bin/linux-amd64/bin-linux-amd64.gz | |
fyne-cross/bin/linux-arm64/bin-linux-arm64.gz | |
fyne-cross/dist/linux-amd64/Prosper-linux-amd64.tar.xz | |
fyne-cross/dist/linux-arm64/Prosper-linux-arm64.tar.xz | |
fyne-cross/bin/windows-amd64/bin-windows-amd64.gz | |
fyne-cross/dist/windows-amd64/Prosper-windows-amd64.zip |