Fixed CD script #18
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: CD | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| build_release: | |
| name: build_release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: 1.25.3 | |
| - name: Build | |
| run: | | |
| env GOOS=linux GOARCH=amd64 go build | |
| gzip --keep bricks-cli | |
| mv bricks-cli.gz bricks-cli-linux-x64.gz | |
| env GOOS=windows GOARCH=amd64 go build | |
| zip bricks-cli-windows-x64.zip bricks-cli.exe | |
| - name: Version | |
| run: | | |
| v=$(./bricks-cli --version) | |
| echo "::set-output name=version::${v:15}" | |
| id: version | |
| - name: Release | |
| uses: actions/create-release@v1 | |
| id: create_release | |
| with: | |
| draft: false | |
| prerelease: false | |
| release_name: ${{ steps.version.outputs.version }} | |
| tag_name: ${{ github.ref }} | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| - name: Upload Linux executable | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./bricks-cli-linux-x64.gz | |
| asset_name: bricks-cli-linux-x64.gz | |
| asset_content_type: application/x-executable | |
| - name: Upload Windows executable | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./bricks-cli-windows-x64.zip | |
| asset_name: bricks-cli-windows-x64.zip | |
| asset_content_type: application/octet-stream; version="64 bit" |