Fixed logs list error #12
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: | |
| tag: | |
| description: "Tag to build and publish (e.g. v1.0.0)" | |
| required: true | |
| permissions: | |
| contents: write | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', github.event.inputs.tag) || github.ref }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23" | |
| - name: Set version from tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_ENV | |
| else | |
| echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
| fi | |
| - name: Build all platforms | |
| run: | | |
| BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ') | |
| LDFLAGS="-s -w -X github.com/cipi-sh/cli/cmd.Version=${{ env.VERSION }} -X github.com/cipi-sh/cli/cmd.BuildTime=${BUILD_TIME}" | |
| mkdir -p dist | |
| GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o dist/cipi-cli-linux-amd64 . | |
| GOOS=linux GOARCH=arm64 go build -ldflags "${LDFLAGS}" -o dist/cipi-cli-linux-arm64 . | |
| GOOS=darwin GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o dist/cipi-cli-darwin-amd64 . | |
| GOOS=darwin GOARCH=arm64 go build -ldflags "${LDFLAGS}" -o dist/cipi-cli-darwin-arm64 . | |
| cd dist && sha256sum * > checksums.txt | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| dist/cipi-cli-linux-amd64 | |
| dist/cipi-cli-linux-arm64 | |
| dist/cipi-cli-darwin-amd64 | |
| dist/cipi-cli-darwin-arm64 | |
| dist/checksums.txt |