feat: add Windows PowerShell installer and packaging support #20
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*" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Release version, for example v0.1.0" | |
| required: true | |
| permissions: | |
| contents: write | |
| env: | |
| BOXLITE_CLI_VERSION: v0.9.0 | |
| jobs: | |
| build-and-release: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| include_boxlite: 1 | |
| cgo_enabled: 0 | |
| - runner: ubuntu-24.04-arm | |
| goos: linux | |
| goarch: arm64 | |
| include_boxlite: 1 | |
| cgo_enabled: 0 | |
| - runner: macos-14 | |
| goos: darwin | |
| goarch: arm64 | |
| include_boxlite: 1 | |
| cgo_enabled: 0 | |
| - runner: macos-13 | |
| goos: darwin | |
| goarch: amd64 | |
| include_boxlite: 0 | |
| cgo_enabled: 0 | |
| - runner: windows-latest | |
| goos: windows | |
| goarch: amd64 | |
| include_boxlite: 0 | |
| cgo_enabled: 0 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Resolve version | |
| id: version | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| version="${{ github.event.inputs.version }}" | |
| else | |
| version="${GITHUB_REF_NAME}" | |
| fi | |
| echo "value=${version}" >> "$GITHUB_OUTPUT" | |
| - name: Resolve build metadata | |
| id: build_meta | |
| shell: bash | |
| run: | | |
| echo "commit=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" | |
| echo "build_time=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT" | |
| - name: Package release archive | |
| shell: bash | |
| run: | | |
| chmod +x scripts/package-release.sh | |
| VERSION="${{ steps.version.outputs.value }}" \ | |
| COMMIT="${{ steps.build_meta.outputs.commit }}" \ | |
| BUILD_TIME="${{ steps.build_meta.outputs.build_time }}" \ | |
| DIST_DIR=dist \ | |
| APP=csgclaw \ | |
| GOCACHE="${{ github.workspace }}/.gocache" \ | |
| INCLUDE_BOXLITE="${{ matrix.include_boxlite }}" \ | |
| BOXLITE_CLI_VERSION="${{ env.BOXLITE_CLI_VERSION }}" \ | |
| CGO_ENABLED="${{ matrix.cgo_enabled }}" \ | |
| ./scripts/package-release.sh "${{ matrix.goos }}" "${{ matrix.goarch }}" | |
| VERSION="${{ steps.version.outputs.value }}" \ | |
| COMMIT="${{ steps.build_meta.outputs.commit }}" \ | |
| BUILD_TIME="${{ steps.build_meta.outputs.build_time }}" \ | |
| DIST_DIR=dist \ | |
| APP=csgclaw-cli \ | |
| GOCACHE="${{ github.workspace }}/.gocache" \ | |
| INCLUDE_BOXLITE=0 \ | |
| CGO_ENABLED="${{ matrix.cgo_enabled }}" \ | |
| ./scripts/package-release.sh "${{ matrix.goos }}" "${{ matrix.goarch }}" | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.value }} | |
| files: dist/* |