Bump version for release #43
Workflow file for this run
This file contains hidden or 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 Daily App | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Trigger on tags starting with 'v' | |
| jobs: | |
| # Read the TOML file first and provide its info to other jobs | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| app_name: ${{ steps.get_info.outputs.name }} | |
| app_version: ${{ steps.get_info.outputs.version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Get app info from FyneApp.toml | |
| id: get_info | |
| run: | | |
| APP_NAME=$(grep '^ Name' FyneApp.toml | awk -F'=' '{print $2}' | tr -d ' "') | |
| APP_VERSION=$(grep '^ Version' FyneApp.toml | awk -F'=' '{print $2}' | tr -d ' "') | |
| echo "App Name: $APP_NAME" | |
| echo "App Version: $APP_VERSION" | |
| # Make the info available to other jobs as outputs | |
| echo "name=$APP_NAME" >> $GITHUB_OUTPUT | |
| echo "version=$APP_VERSION" >> $GITHUB_OUTPUT | |
| - name: Validate version matches tag | |
| run: | | |
| # Ensure the version in FyneApp.toml has been updated before tagging a new release | |
| tag_version="${{ github.ref_name }}" | |
| file_version="v${{ steps.get_info.outputs.version }}" | |
| echo "Git Tag: $tag_version" | |
| echo "TOML Version: $file_version" | |
| if [ "$tag_version" != "$file_version" ]; then | |
| echo "Error: Git tag ($tag_version) does not match the version in FyneApp.toml ($file_version)" | |
| exit 1 | |
| fi | |
| build: | |
| # Use a build matrix to build on all three platforms | |
| needs: prepare | |
| strategy: | |
| matrix: | |
| goos: [ linux, windows, darwin ] | |
| include: | |
| - goos: linux | |
| os: ubuntu-latest | |
| - goos: windows | |
| os: windows-latest | |
| - goos: darwin | |
| os: macos-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.work | |
| - name: Create client.json from secret | |
| shell: bash | |
| env: | |
| CLIENT_SECRET_JSON: ${{ secrets.CLIENT_SECRET_JSON }} | |
| run: | | |
| if [ -z "$CLIENT_SECRET_JSON" ]; then | |
| echo "CLIENT_SECRET_JSON secret is not set. Aborting." | |
| exit 1 | |
| fi | |
| mkdir -p secrets | |
| echo "$CLIENT_SECRET_JSON" > secrets/client.json | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev xorg-dev | |
| - name: Install Fyne | |
| run: go install fyne.io/tools/cmd/fyne@latest | |
| - name: Build and package | |
| run: fyne package -os ${{ matrix.goos }} -release | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-${{ matrix.goos }} | |
| path: "${{ needs.prepare.outputs.app_name }}.*" | |
| if-no-files-found: error | |
| release: | |
| needs: [ prepare, build ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Prepare artifacts | |
| run: | | |
| APP_NAME="${{ needs.prepare.outputs.app_name }}" | |
| APP_VERSION="${{ needs.prepare.outputs.app_version }}" | |
| # linux | |
| mv "dist/app-linux/$APP_NAME.tar.xz" "dist/$APP_NAME-$APP_VERSION-linux.tar.xz" | |
| # mac | |
| zip -r "dist/$APP_NAME-$APP_VERSION-mac.zip" "dist/app-darwin/$APP_NAME.app" | |
| # windows | |
| zip "dist/$APP_NAME-$APP_VERSION-win.exe.zip" "dist/app-windows/$APP_NAME.exe" | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| APP_NAME="${{ needs.prepare.outputs.app_name }}" | |
| APP_VERSION="${{ needs.prepare.outputs.app_version }}" | |
| gh release create ${{ github.ref }} \ | |
| --title "$APP_NAME v${{ needs.prepare.outputs.app_version }}" --generate-notes \ | |
| dist/$APP_NAME-$APP_VERSION-linux.tar.xz dist/$APP_NAME-$APP_VERSION-mac.zip dist/$APP_NAME-$APP_VERSION-win.exe.zip |