Build #4
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: Build | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Release version (e.g., 1.0.0)" | |
| required: true | |
| default: "1.0.0" | |
| draft: | |
| description: "Create as draft release?" | |
| required: false | |
| default: false | |
| type: boolean | |
| prerelease: | |
| description: "Mark as pre-release?" | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| env: | |
| VERSION: ${{ inputs.version }} | |
| BINARY_NAME: gde | |
| jobs: | |
| build-linux: | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23" | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install pnpm | |
| run: npm install -g pnpm | |
| - name: Install Wails | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev | |
| - name: Build | |
| working-directory: src | |
| run: wails build -tags webkit2_41 -platform linux/${{ matrix.arch }} -o gde | |
| - name: Package | |
| run: | | |
| mkdir -p out/linux-${{ matrix.arch }} | |
| mv src/build/bin/gde out/linux-${{ matrix.arch }}/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gde-linux-${{ matrix.arch }} | |
| path: out/linux-${{ matrix.arch }} | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23" | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install pnpm | |
| run: npm install -g pnpm | |
| - name: Install Wails | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Build | |
| working-directory: src | |
| run: wails build -platform windows/amd64 -o gde.exe | |
| - name: Package | |
| shell: bash | |
| run: | | |
| mkdir -p out/windows-amd64 | |
| mv src/build/bin/gde.exe out/windows-amd64/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gde-windows-amd64 | |
| path: out/windows-amd64 | |
| build-macos: | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23" | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install pnpm | |
| run: npm install -g pnpm | |
| - name: Install Wails | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Build | |
| working-directory: src | |
| run: wails build -platform darwin/${{ matrix.arch }} -o gde | |
| - name: Package | |
| run: | | |
| mkdir -p out/darwin-${{ matrix.arch }} | |
| mv src/build/bin/geodatexplorer.app out/darwin-${{ matrix.arch }}/gde.app | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gde-darwin-${{ matrix.arch }} | |
| path: out/darwin-${{ matrix.arch }} | |
| release: | |
| needs: [build-linux, build-windows, build-macos] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create archives | |
| run: | | |
| cd artifacts | |
| for dir in */; do | |
| name="${dir%/}" | |
| if [[ "$name" == *windows* ]]; then | |
| zip -r "${name}.zip" "$dir" | |
| else | |
| tar -czvf "${name}.tar.gz" "$dir" | |
| fi | |
| done | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.VERSION }} | |
| name: v${{ env.VERSION }} | |
| draft: ${{ inputs.draft }} | |
| prerelease: ${{ inputs.prerelease }} | |
| files: | | |
| artifacts/*.tar.gz | |
| artifacts/*.zip | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |