remove windows
All checks were successful
All checks were successful
This commit is contained in:
@@ -10,7 +10,7 @@ env:
|
|||||||
JAVA_VERSION: "17"
|
JAVA_VERSION: "17"
|
||||||
ANDROID_SDK_ROOT: "${{ github.workspace }}/android-sdk"
|
ANDROID_SDK_ROOT: "${{ github.workspace }}/android-sdk"
|
||||||
FLUTTER_VERSION: "3.38.5"
|
FLUTTER_VERSION: "3.38.5"
|
||||||
BUILD_WINDOWS: "true"
|
BUILD_WINDOWS: "false" # Windows build disabled (no runner available)
|
||||||
GITEA_BASE_URL: https://git.tgj.services
|
GITEA_BASE_URL: https://git.tgj.services
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -238,58 +238,6 @@ jobs:
|
|||||||
name: linux-bundle
|
name: linux-bundle
|
||||||
path: app-linux-x64.tar.gz
|
path: app-linux-x64.tar.gz
|
||||||
|
|
||||||
windows-build:
|
|
||||||
runs-on:
|
|
||||||
- mileograph
|
|
||||||
needs: meta
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Flutter SDK (Windows)
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$ErrorActionPreference = "Stop"
|
|
||||||
$flutterHome = "$env:USERPROFILE\flutter"
|
|
||||||
if (-Not (Test-Path "$flutterHome\bin\flutter.bat")) {
|
|
||||||
if (Test-Path $flutterHome) { Remove-Item -Recurse -Force $flutterHome }
|
|
||||||
$flutterZip = "$env:TEMP\flutter_windows_${env:FLUTTER_VERSION}-stable.zip"
|
|
||||||
Invoke-WebRequest -Uri "https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_${env:FLUTTER_VERSION}-stable.zip" -OutFile $flutterZip
|
|
||||||
Expand-Archive -Path $flutterZip -DestinationPath $env:USERPROFILE -Force
|
|
||||||
}
|
|
||||||
"$flutterHome\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
||||||
& "$flutterHome\bin\flutter.bat" --version
|
|
||||||
|
|
||||||
- name: Allow all git directories (CI)
|
|
||||||
run: git config --global --add safe.directory '*'
|
|
||||||
|
|
||||||
- name: Set pub cache path
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
"PUB_CACHE=$env:GITHUB_WORKSPACE\.pub-cache" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
||||||
|
|
||||||
- name: Enable Windows desktop
|
|
||||||
run: flutter config --enable-windows-desktop
|
|
||||||
|
|
||||||
- name: Flutter dependencies
|
|
||||||
run: flutter pub get
|
|
||||||
|
|
||||||
- name: Build Windows binary (release)
|
|
||||||
env:
|
|
||||||
BASE_VERSION: ${{ needs.meta.outputs.base_version }}
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$ErrorActionPreference = "Stop"
|
|
||||||
flutter build windows --release
|
|
||||||
$zipName = "mileograph-windows-$env:BASE_VERSION.zip"
|
|
||||||
Compress-Archive -Path "build/windows/x64/runner/Release/*" -DestinationPath $zipName -Force
|
|
||||||
|
|
||||||
- name: Upload Windows artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: windows-bundle
|
|
||||||
path: mileograph-windows-${{ needs.meta.outputs.base_version }}.zip
|
|
||||||
|
|
||||||
release-dev:
|
release-dev:
|
||||||
runs-on:
|
runs-on:
|
||||||
- mileograph
|
- mileograph
|
||||||
@@ -297,7 +245,6 @@ jobs:
|
|||||||
- meta
|
- meta
|
||||||
- android-build
|
- android-build
|
||||||
- linux-build
|
- linux-build
|
||||||
- windows-build
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install jq
|
- name: Install jq
|
||||||
run: |
|
run: |
|
||||||
@@ -315,13 +262,6 @@ jobs:
|
|||||||
name: android-apk
|
name: android-apk
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Download Windows bundle
|
|
||||||
if: ${{ github.ref == 'refs/heads/dev' }}
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: windows-bundle
|
|
||||||
path: artifacts
|
|
||||||
|
|
||||||
- name: Prepare APK and tag
|
- name: Prepare APK and tag
|
||||||
if: ${{ github.ref == 'refs/heads/dev' }}
|
if: ${{ github.ref == 'refs/heads/dev' }}
|
||||||
id: bundle
|
id: bundle
|
||||||
@@ -330,11 +270,9 @@ jobs:
|
|||||||
TAG="${{ needs.meta.outputs.release_tag }}"
|
TAG="${{ needs.meta.outputs.release_tag }}"
|
||||||
|
|
||||||
mv "artifacts/mileograph-${BASE}.apk" "artifacts/mileograph-${BASE}-dev.apk"
|
mv "artifacts/mileograph-${BASE}.apk" "artifacts/mileograph-${BASE}-dev.apk"
|
||||||
mv "artifacts/mileograph-windows-${BASE}.zip" "artifacts/mileograph-windows-${BASE}-dev.zip"
|
|
||||||
|
|
||||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
echo "apk=artifacts/mileograph-${BASE}-dev.apk" >> "$GITHUB_OUTPUT"
|
echo "apk=artifacts/mileograph-${BASE}-dev.apk" >> "$GITHUB_OUTPUT"
|
||||||
echo "windows_zip=artifacts/mileograph-windows-${BASE}-dev.zip" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Create prerelease on Gitea
|
- name: Create prerelease on Gitea
|
||||||
if: ${{ github.ref == 'refs/heads/dev' }}
|
if: ${{ github.ref == 'refs/heads/dev' }}
|
||||||
@@ -375,32 +313,6 @@ jobs:
|
|||||||
"${GITEA_BASE_URL}/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
|
"${GITEA_BASE_URL}/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
|
||||||
>/dev/null
|
>/dev/null
|
||||||
|
|
||||||
- name: Attach Windows bundle to Gitea release
|
|
||||||
if: ${{ github.ref == 'refs/heads/dev' }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
TAG="${{ steps.bundle.outputs.tag }}"
|
|
||||||
ZIP="${{ steps.bundle.outputs.windows_zip }}"
|
|
||||||
|
|
||||||
RELEASE_JSON=$(curl -sS \
|
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
||||||
"${GITEA_BASE_URL}/api/v1/repos/${{ github.repository }}/releases/tags/${TAG}")
|
|
||||||
|
|
||||||
RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id')
|
|
||||||
|
|
||||||
echo "Release ID: $RELEASE_ID"
|
|
||||||
|
|
||||||
NAME=$(basename "$ZIP")
|
|
||||||
echo "Uploading $NAME"
|
|
||||||
|
|
||||||
curl -sS -X POST \
|
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
||||||
-F "attachment=@${ZIP}" \
|
|
||||||
-F "name=${NAME}" \
|
|
||||||
"${GITEA_BASE_URL}/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
|
|
||||||
>/dev/null
|
|
||||||
|
|
||||||
release-master:
|
release-master:
|
||||||
runs-on:
|
runs-on:
|
||||||
- mileograph
|
- mileograph
|
||||||
@@ -408,7 +320,6 @@ jobs:
|
|||||||
- meta
|
- meta
|
||||||
- android-build
|
- android-build
|
||||||
- linux-build
|
- linux-build
|
||||||
- windows-build
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install jq
|
- name: Install jq
|
||||||
run: |
|
run: |
|
||||||
@@ -426,13 +337,6 @@ jobs:
|
|||||||
name: android-apk
|
name: android-apk
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Download Windows bundle
|
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: windows-bundle
|
|
||||||
path: artifacts
|
|
||||||
|
|
||||||
- name: Prepare APK and tag
|
- name: Prepare APK and tag
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
id: bundle
|
id: bundle
|
||||||
@@ -442,7 +346,6 @@ jobs:
|
|||||||
|
|
||||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
echo "apk=artifacts/mileograph-${BASE}.apk" >> "$GITHUB_OUTPUT"
|
echo "apk=artifacts/mileograph-${BASE}.apk" >> "$GITHUB_OUTPUT"
|
||||||
echo "windows_zip=artifacts/mileograph-windows-${BASE}.zip" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Create release on Gitea
|
- name: Create release on Gitea
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
@@ -481,29 +384,3 @@ jobs:
|
|||||||
-F "name=${NAME}" \
|
-F "name=${NAME}" \
|
||||||
"${GITEA_BASE_URL}/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
|
"${GITEA_BASE_URL}/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
|
||||||
>/dev/null
|
>/dev/null
|
||||||
|
|
||||||
- name: Attach Windows bundle to Gitea release
|
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
TAG="${{ steps.bundle.outputs.tag }}"
|
|
||||||
ZIP="${{ steps.bundle.outputs.windows_zip }}"
|
|
||||||
|
|
||||||
RELEASE_JSON=$(curl -sS \
|
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
||||||
"${GITEA_BASE_URL}/api/v1/repos/${{ github.repository }}/releases/tags/${TAG}")
|
|
||||||
|
|
||||||
RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id')
|
|
||||||
|
|
||||||
echo "Release ID: $RELEASE_ID"
|
|
||||||
|
|
||||||
NAME=$(basename "$ZIP")
|
|
||||||
echo "Uploading $NAME"
|
|
||||||
|
|
||||||
curl -sS -X POST \
|
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
||||||
-F "attachment=@${ZIP}" \
|
|
||||||
-F "name=${NAME}" \
|
|
||||||
"${GITEA_BASE_URL}/api/v1/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" \
|
|
||||||
>/dev/null
|
|
||||||
|
|||||||
Reference in New Issue
Block a user