name: release on: push: tags: ['v*'] workflow_dispatch: env: NODE_VERSION: '22' GO_VERSION: 'stable' jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: '22' } - uses: actions/setup-go@v5 with: { go-version: 'stable' } - name: Build frontend run: make frontend && rm -rf server/webdist/dist && cp -r frontend/dist server/webdist/dist - name: Go tests run: cd server && go vet ./... && go test ./... server: needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: '22' } - uses: actions/setup-go@v5 with: { go-version: 'stable' } - name: Build tefterd for all platforms run: make server-all VERSION=${{ github.ref_name }} - uses: actions/upload-artifact@v4 with: name: tefterd path: build/tefterd-* desktop: needs: test strategy: matrix: include: - os: ubuntu-latest artifact: tefter-desktop-linux - os: macos-latest artifact: tefter-desktop-macos - os: windows-latest artifact: tefter-desktop-windows runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: '22' } - uses: actions/setup-go@v5 with: { go-version: 'stable' } - name: Linux deps if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libx11-dev - name: Install Wails run: go install github.com/wailsapp/wails/v2/cmd/wails@latest - name: Build frontend run: make frontend VERSION=${{ github.ref_name }} - name: Copy bundle into desktop shell: bash run: | rm -rf desktop/frontend/dist mkdir -p desktop/frontend cp -r frontend/dist desktop/frontend/dist - name: Wails build (Linux) if: runner.os == 'Linux' run: cd desktop && wails build -tags webkit2_41 -ldflags "-X main.Version=${{ github.ref_name }}" - name: Wails build (macOS) if: runner.os == 'macOS' run: | cd desktop && wails build -ldflags "-X main.Version=${{ github.ref_name }}" cd build/bin && zip -r Tefter.app.zip Tefter.app - name: Wails build (Windows) if: runner.os == 'Windows' run: cd desktop && wails build -ldflags "-X main.Version=${{ github.ref_name }}" - name: Package Linux artifact (.desktop file included) if: runner.os == 'Linux' run: | mkdir -p pkg cp desktop/build/bin/tefter-desktop pkg/ cp desktop/tefter.desktop pkg/ cp frontend/public/icon-512.png pkg/tefter.png tar -C pkg -czf tefter-desktop-linux-amd64.tar.gz . - uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact }} path: | tefter-desktop-linux-amd64.tar.gz desktop/build/bin/Tefter.app.zip desktop/build/bin/tefter-desktop.exe if-no-files-found: ignore release: needs: [server, desktop] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') permissions: contents: write steps: - uses: actions/download-artifact@v4 with: { merge-multiple: true, path: dist } - uses: softprops/action-gh-release@v2 with: files: dist/** generate_release_notes: true