Bump version to 0.2.1 #57
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: Build and Upload | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'main' | |
- 'build/*' | |
tags: | |
- 'v*' | |
paths-ignore: | |
- '**.md' | |
env: | |
FLUTTER_VERSION: 3.10.5 | |
jobs: | |
build-android: | |
name: Build Android | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '${{ env.FLUTTER_VERSION }}' | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build APK | |
run: flutter build apk | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: URSADriverStation_android | |
path: build/app/outputs/flutter-apk/*.apk | |
- name: Rename artifact | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
ls -R build/app/outputs/flutter-apk | |
mkdir gh-release | |
cp build/app/outputs/flutter-apk/app-release.apk gh-release/URSADriverStation-${GITHUB_REF#refs/tags/v}_android.apk | |
- name: Upload release artifact | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
gh-release/*.apk | |
build-linux: | |
name: Build Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '${{ env.FLUTTER_VERSION }}' | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y ninja-build libglib2.0-dev libgtk-3-dev libfuse2 | |
flutter pub get | |
- name: Build Linux package | |
run: flutter build linux | |
- name: Create AppImage | |
run: | | |
cp -r build/linux/x64/release/bundle build/linux/AppDir | |
cd build/ | |
# Install appimage-builder | |
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage | |
chmod +x appimage-builder-x86_64.AppImage | |
cd linux/ | |
../appimage-builder-x86_64.AppImage --recipe ../../AppImageBuilder.yml --skip-test | |
ls -l | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: URSADriverStation_linux_x64 | |
path: build/linux/*.AppImage | |
- name: Rename artifact | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
ls -R build/linux | |
mkdir gh-release | |
cp "build/linux/URSA Driver Station-latest-x86_64.AppImage" gh-release/URSADriverStation-${GITHUB_REF#refs/tags/v}_linux_x64.AppImage | |
- name: Upload release artifact | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
gh-release/*.AppImage | |
build-windows: | |
name: Build Windows | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '${{ env.FLUTTER_VERSION }}' | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build Windows package | |
run: flutter build windows | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: URSADriverStation_windows_x64 | |
path: build/windows/runner/Release | |
- name: Rename artifact | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
ls -R build/windows/runner/Release | |
mkdir gh-release | |
# Get the tag name by removing "refs/tags/v" | |
$tagName = $env:GITHUB_REF -replace "refs/tags/v", "" | |
# Create the archive | |
Compress-Archive -Path build/windows/runner/Release -DestinationPath ("gh-release/URSADriverStation-" + $tagName + "_windows_x64.zip") | |
ls -R gh-release | |
- name: Upload release artifact | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
gh-release/*.zip |