docs(changelog): v3.1.13 release notes #112
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 | |
| # Releasing: push a `v*` tag (e.g. `git tag v3.1.0 && git push --tags`) and the | |
| # three-platform build + GitHub Release runs automatically. To validate without | |
| # publishing, use "Run workflow" in the Actions UI (workflow_dispatch) — it | |
| # produces a DRAFT release tagged with whatever label you enter, which you can | |
| # inspect and delete. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version label for artifacts (e.g. v3.1.0-rc1). A DRAFT release is created — no published release, safe to delete.' | |
| required: true | |
| default: 'v0.0.0-dryrun' | |
| # softprops/action-gh-release needs to create the release + tag. | |
| permissions: | |
| contents: write | |
| # On a tag push GITHUB_REF_NAME is the tag (e.g. v3.1.0). On workflow_dispatch | |
| # we use the input. Either way this is both the artifact label and the tag. | |
| env: | |
| VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }} | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.name }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { runner: macos-14, target: darwin/universal, name: Darwin_universal } | |
| - { runner: ubuntu-22.04, target: linux/amd64, name: Linux_x86_64 } | |
| - { runner: windows-latest, target: windows/amd64, name: Windows_x86_64 } | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25.x' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install Wails CLI | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Install Linux build deps | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev | |
| # main.Version is the app version var (main.go), injected via ldflags on | |
| # every platform. Defaults to "dev" when unset. | |
| - name: Build (Wails) | |
| shell: bash | |
| run: wails build -platform ${{ matrix.target }} -ldflags "-X main.Version=${{ env.VERSION }}" | |
| # ---- macOS: always ship a zipped .app; dmg is best-effort ---- | |
| # Write the .zip to the repo root (GITHUB_WORKSPACE), same as the .dmg / | |
| # .tar.gz / Windows .zip, so the shared upload-artifact step picks it up. | |
| - name: Package macOS (.app zip) | |
| if: runner.os == 'macOS' | |
| run: | | |
| ditto -c -k --keepParent build/bin/Medict.app "Medict_${{ env.VERSION }}_${{ matrix.name }}.zip" | |
| - name: Package macOS (.dmg) | |
| if: runner.os == 'macOS' | |
| continue-on-error: true | |
| run: | | |
| brew install create-dmg | |
| create-dmg \ | |
| --volname "Medict" \ | |
| --volicon "build/assets/darwin/dmg_icon.icns" \ | |
| --background "build/assets/darwin/dmg_bg.png" \ | |
| --window-size 512 360 --icon-size 100 \ | |
| --icon "Medict.app" 100 185 \ | |
| --hide-extension "Medict.app" \ | |
| --app-drop-link 388 185 \ | |
| "Medict_${{ env.VERSION }}_${{ matrix.name }}.dmg" \ | |
| "build/bin" | |
| # ---- Linux: tar.gz ---- | |
| - name: Package Linux | |
| if: runner.os == 'Linux' | |
| run: tar -C build/bin -czf "Medict_${{ env.VERSION }}_${{ matrix.name }}.tar.gz" Medict | |
| # ---- Windows: zip ---- | |
| - name: Package Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: Compress-Archive -Path build/bin/Medict.exe -DestinationPath "Medict_${{ env.VERSION }}_${{ matrix.name }}.zip" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Medict_${{ env.VERSION }}_${{ matrix.name }} | |
| path: | | |
| Medict_${{ env.VERSION }}_${{ matrix.name }}.zip | |
| Medict_${{ env.VERSION }}_${{ matrix.name }}.dmg | |
| Medict_${{ env.VERSION }}_${{ matrix.name }}.tar.gz | |
| if-no-files-found: error | |
| release: | |
| name: Publish release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: assets | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: ls -lhR assets | |
| # Release notes = the top `## vX.Y.Z` section of CHANGELOG.md (everything | |
| # up to the next `## `). Empty if CHANGELOG.md has no matching section. | |
| - name: Collect release notes from CHANGELOG.md | |
| id: notes | |
| run: | | |
| { | |
| echo "body<<EOF" | |
| awk '/^## /{c++} c==1{print} c==2{exit}' CHANGELOG.md | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Create / update GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.VERSION }} | |
| name: ${{ env.VERSION }} | |
| body: ${{ steps.notes.outputs.body }} | |
| files: | | |
| assets/*.zip | |
| assets/*.dmg | |
| assets/*.tar.gz | |
| # tag push -> published; manual dispatch -> draft (validation only) | |
| draft: ${{ github.event_name == 'workflow_dispatch' }} | |
| # v3.1.0 -> stable; v3.1.0-rc1 / v3.1.0-beta -> prerelease | |
| prerelease: ${{ contains(env.VERSION, '-') }} |