v1.4.0-snapshot #3
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: | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build and Upload Artifacts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.21 | |
| - name: Download Go tools | |
| run: | | |
| go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 | |
| go install golang.org/x/tools/cmd/goimports@latest | |
| echo "PATH=$PATH:$(go env GOPATH)/bin" >> $GITHUB_ENV | |
| - name: Run lint | |
| run: make lint | |
| - | |
| name: Download OpenShift client | |
| run: | | |
| mkdir -p ~/oc | |
| cd ~/oc | |
| curl -L https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz -o oc.tar.gz | |
| tar -xzf oc.tar.gz | |
| echo "$HOME/oc" >> $GITHUB_PATH | |
| - name: Run unit tests | |
| run: make test-unit | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| TAG=${{ github.event.release.tag_name }} | |
| VERSION=${TAG#v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Build binaries | |
| run: make build VERSION=${{ steps.version.outputs.version }} | |
| - name: Upload Linux binary | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ./cmd/tailor/tailor-linux-amd64 | |
| asset_name: tailor-linux-amd64 | |
| asset_content_type: application/octet-stream | |
| - name: Upload macOS binary | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ./cmd/tailor/tailor-darwin-amd64 | |
| asset_name: tailor-darwin-amd64 | |
| asset_content_type: application/octet-stream | |
| - name: Upload Windows binary | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ./cmd/tailor/tailor-windows-amd64.exe | |
| asset_name: tailor-windows-amd64.exe | |
| asset_content_type: application/octet-stream |