improved index.js to reduce its bloat #207
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
| # This workflow will build a golang project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
| name: GoReleaser | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: 'Run in dry-run mode (no actual release)' | |
| required: false | |
| type: boolean | |
| default: false | |
| verbose: | |
| description: 'Enable verbose logging' | |
| required: false | |
| type: boolean | |
| default: false | |
| skip_tests: | |
| description: 'Skip running tests' | |
| required: false | |
| type: boolean | |
| default: false | |
| push: | |
| tags: | |
| - '*' # run on new tags | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout # required for the changelog to work correctly | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go with cache | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.26.1' | |
| cache: true | |
| - name: Cache Go modules | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Validate GoReleaser config | |
| run: | | |
| if [ ! -f init/.goreleaser.yaml ]; then | |
| echo "Error: init/.goreleaser.yaml not found" | |
| exit 1 | |
| fi | |
| - name: Skip pre-release tags | |
| if: contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') | |
| run: | | |
| echo "Skipping pre-release tag: ${{ github.ref }}" | |
| exit 0 | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean --config init/.goreleaser.yaml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GORELEASER_DEBUG: true # leave on, because this workflow is fickle | |
| - name: Smoke test binary | |
| run: | | |
| ./dist/server_linux_amd64_v1/defacto2-server --help > /dev/null | |
| echo "✓ Binary smoke test passed" | |
| - name: Generate SLSA provenance | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: 'dist/*' |