ci: fix nfpm --output flag #16
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| goos: linux | |
| goarch: amd64 | |
| pkg_deps: libgtk-3-dev libwebkit2gtk-4.0-dev | |
| # macOS disabled (Wails SDK linker issue on ARM runners) | |
| # - os: macos-13 | |
| # goos: darwin | |
| # goarch: amd64 | |
| # pkg_deps: "" | |
| # - os: macos-latest | |
| # goos: darwin | |
| # goarch: arm64 | |
| # pkg_deps: "" | |
| - os: windows-latest | |
| goos: windows | |
| goarch: amd64 | |
| pkg_deps: "" | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install system deps | |
| if: matrix.pkg_deps != '' | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq ${{ matrix.pkg_deps }} | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.26" | |
| cache: true | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Build frontend | |
| run: | | |
| cd frontend | |
| npm ci | |
| npm run build | |
| - name: Build with Wails | |
| run: wails build -tags "desktop,production" -ldflags "-s -w -X main.version=${{ github.ref_name }}" | |
| env: | |
| CGO_ENABLED: 1 | |
| GOARCH: ${{ matrix.goarch }} | |
| # nfpm packaging (Linux only) | |
| - name: Install nfpm | |
| if: matrix.goos == 'linux' | |
| run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest | |
| - name: Build nfpm packages | |
| if: matrix.goos == 'linux' | |
| run: | | |
| mkdir -p _packages | |
| for fmt in deb rpm apk arch; do | |
| echo "Building $fmt package..." | |
| nfpm package --config build/linux/nfpm.yml --packager "$fmt" --output "_packages/" || echo "Warning: $fmt package failed (continuing)" | |
| done | |
| ls -la _packages/ | |
| env: | |
| MDLIGHT_VERSION: ${{ github.ref_name }} | |
| - name: Rename binary for release | |
| shell: bash | |
| run: | | |
| ext="" | |
| [ "${{ matrix.goos }}" = "windows" ] && ext=".exe" | |
| mv build/bin/mdlight$ext build/bin/mdlight_${{ github.ref_name }}_${{ matrix.goos }}_${{ matrix.goarch }}$ext | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: mdlight-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: | | |
| build/bin/mdlight_* | |
| _packages/* | |
| scripts/install.sh | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: _artifacts | |
| - name: Generate checksums | |
| run: | | |
| find _artifacts -type f \( -name 'mdlight_*' -o -name '*.deb' -o -name '*.rpm' -o -name '*.apk' -o -name '*.pkg.tar.*' -o -name 'install.sh' \) -exec sha256sum {} \; > checksums.txt | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| _artifacts/**/mdlight_* | |
| _artifacts/**/*.deb | |
| _artifacts/**/*.rpm | |
| _artifacts/**/*.apk | |
| _artifacts/**/*.pkg.tar.* | |
| _artifacts/**/install.sh | |
| checksums.txt | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true |