v1.1.2 release π #3
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 | |
| run-name: "${{ github.event.inputs.kubesolo_version }} release π" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| kubesolo_version: | |
| description: "kubesolo version. e.g. v0.x.x, v0.x.x-beta" | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: create a pre-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "[execution] create a pre-release" | |
| run: | | |
| gh release create \ | |
| ${{ github.event.inputs.kubesolo_version }} \ | |
| --repo nirvati/kubesolo \ | |
| --title ${{ github.event.inputs.kubesolo_version }} \ | |
| --target develop \ | |
| --prerelease \ | |
| --generate-notes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build: | |
| name: release for kubesolo-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.libc == 'musl' && '-musl' || '' }} | |
| runs-on: ubuntu-latest | |
| needs: [release] | |
| strategy: | |
| matrix: | |
| include: | |
| # glibc builds (all architectures) | |
| - goos: linux | |
| goarch: amd64 | |
| libc: glibc | |
| build_target: build | |
| - goos: linux | |
| goarch: arm64 | |
| libc: glibc | |
| build_target: build | |
| - goos: linux | |
| goarch: arm | |
| libc: glibc | |
| build_target: build | |
| - goos: linux | |
| goarch: riscv64 | |
| libc: glibc | |
| build_target: build | |
| # musl builds (amd64 and arm64 only) | |
| - goos: linux | |
| goarch: amd64 | |
| libc: musl | |
| build_target: build-musl | |
| - goos: linux | |
| goarch: arm64 | |
| libc: musl | |
| build_target: build-musl | |
| steps: | |
| - name: "[preparation] checkout the current branch" | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| tags: true | |
| - name: "[preparation] set build time" | |
| run: echo BUILD_TIME=$(date) >> ${GITHUB_ENV} | |
| - name: "[preparation] set up golang" | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: "[preparation] release-workflow-deps" | |
| run: sudo make release-workflow-deps | |
| - name: "[execution] build the binary for ${{ matrix.goos }}/${{ matrix.goarch }}" | |
| run: make ${{ matrix.build_target }} GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} VERSION=${{ github.event.inputs.kubesolo_version }} OUTPUT=kubesolo | |
| - name: "[post] upload artifacts to github release" | |
| run: | | |
| dist=kubesolo-${{ github.event.inputs.kubesolo_version }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.libc == 'musl' && '-musl' || '' }} | |
| tar -czf $dist.tar.gz kubesolo | |
| gh release upload --clobber --repo nirvati/kubesolo ${{ github.event.inputs.kubesolo_version }} $dist.tar.gz | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |