feat(v3.16.0): security headers + Pages-demo retire + audit doc (#84) #13
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*'] | |
| env: | |
| GO_VERSION: '1.26.0' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-artifacts: | |
| name: Build Artifacts | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: | |
| - { goos: linux, goarch: amd64 } | |
| - { goos: darwin, goarch: amd64 } | |
| - { goos: windows, goarch: amd64 } | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Build binary | |
| env: | |
| GOOS: ${{ matrix.target.goos }} | |
| GOARCH: ${{ matrix.target.goarch }} | |
| CGO_ENABLED: 0 | |
| run: | | |
| EXT="" | |
| if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi | |
| VERSION="${{ github.ref_name || 'dev' }}" | |
| GIT_COMMIT="${{ github.sha }}" | |
| BUILD_TIME="$(date -u '+%Y-%m-%d_%H:%M:%S')" | |
| go build -ldflags="-w -s -X 'github.com/1mb-dev/markgo/internal/constants.AppVersion=${VERSION}' -X 'github.com/1mb-dev/markgo/internal/constants.GitCommit=${GIT_COMMIT}' -X 'github.com/1mb-dev/markgo/internal/constants.BuildTime=${BUILD_TIME}'" \ | |
| -o markgo-${{ matrix.target.goos }}-${{ matrix.target.goarch }}${EXT} \ | |
| ./cmd/markgo | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: markgo-${{ matrix.target.goos }}-${{ matrix.target.goarch }} | |
| path: markgo-* | |
| retention-days: 7 | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: build-artifacts | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: artifacts | |
| - name: Prepare release | |
| run: | | |
| mkdir -p release | |
| find artifacts -name "markgo-*" -type f -exec cp {} release/ \; | |
| - name: Create release | |
| uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 | |
| with: | |
| files: release/* | |
| generate_release_notes: true |