|
8 | 8 | jobs: |
9 | 9 | build: |
10 | 10 | runs-on: ubuntu-latest |
| 11 | + |
| 12 | + env: |
| 13 | + GOOS: ${{ matrix.os }} |
| 14 | + GOARCH: ${{ matrix.arch }} |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: |
| 19 | + - linux |
| 20 | + - darwin |
| 21 | + - windows |
| 22 | + arch: |
| 23 | + - amd64 |
| 24 | + - arm64 |
| 25 | + |
11 | 26 | steps: |
12 | 27 | - name: Version |
13 | 28 | id: version |
@@ -35,35 +50,27 @@ jobs: |
35 | 50 | if: steps.cache-deps.outputs.cache-hit != 'true' |
36 | 51 | run: go mod download |
37 | 52 |
|
38 | | - - name: Build Linux AMD64 |
39 | | - run: GOOS=linux GOARCH=amd64 go build -o kubectl-curl_${{ steps.version.outputs.tag }}_linux_amd64 |
40 | | - |
41 | | - #- name: Build Linux ARM64 |
42 | | - # run: GOOS=linux GOARCH=arm64 go build -o kubectl-curl_${{ steps.version.outputs.tag }}_linux_arm64 |
43 | | - |
44 | | - #- name: Build Darwin AMD64 |
45 | | - # run: GOOS=darwin GOARCH=amd64 go build -o kubectl-curl_${{ steps.version.outputs.tag }}_darwin_amd64 |
46 | | - |
47 | | - #- name: Build Darwin ARM64 |
48 | | - # run: GOOS=darwin GOARCH=arm64 go build -o kubectl-curl_${{ steps.version.outputs.tag }}_darwin_arm64 |
| 53 | + - name: Build Artifacts |
| 54 | + run: | |
| 55 | + out=kubectl-curl_${{ steps.version.outputs.tag }}_${{ env.GOOS }}_${{ env.GOARCH }} |
| 56 | + go build -o $out |
| 57 | + tar czf $out.tar.gz $out LICENSE |
49 | 58 |
|
50 | | - #- name: Build Windows AMD64 |
51 | | - # run: GOOS=windows GOARCH=amd64 go build -o kubectl-curl_${{ steps.version.outputs.tag }}_windows_amd64.exe |
52 | | - |
53 | | - #- name: Build Windows ARM64 |
54 | | - # run: GOOS=windows GOARCH=arm64 go build -o kubectl-curl_${{ steps.version.outputs.tag }}_windows_arm64.exe |
| 59 | + - name: Upload Artifacts |
| 60 | + uses: actions/upload-artifact@v2 |
| 61 | + with: |
| 62 | + name: kubectl-curl_${{ steps.version.outputs.tag }}_${{ env.GOOS }}_${{ env.GOARCH }} |
| 63 | + path: kubectl-curl_${{ steps.version.outputs.tag }}_${{ env.GOOS }}_${{ env.GOARCH }}.tar.gz |
55 | 64 |
|
56 | | - - name: Generate Artifacts |
57 | | - run: for bin in kubectl-curl_*; do tar czf $bin.tar.gz $bin LICENSE; done |
| 65 | + release: |
| 66 | + runs-on: ubuntu-latest |
| 67 | + needs: [build] |
| 68 | + steps: |
| 69 | + - name: Download Artifacts |
| 70 | + with: |
| 71 | + path: . |
58 | 72 |
|
59 | | - - name: Release |
| 73 | + - name: Release Artifacts |
60 | 74 | uses: softprops/action-gh-release@v1 |
61 | 75 | with: |
62 | | - files: | |
63 | | - LICENSE |
64 | | - kubectl-curl_${{ steps.version.outputs.tag }}_linux_amd64.tar.gz |
65 | | - kubectl-curl_${{ steps.version.outputs.tag }}_linux_arm64.tar.gz |
66 | | - kubectl-curl_${{ steps.version.outputs.tag }}_darwin_amd64.tar.gz |
67 | | - kubectl-curl_${{ steps.version.outputs.tag }}_darwin_arm64.tar.gz |
68 | | - kubectl-curl_${{ steps.version.outputs.tag }}_windows_amd64.exe.tar.gz |
69 | | - kubectl-curl_${{ steps.version.outputs.tag }}_windows_arm64.exe.tar.gz |
| 76 | + files: kubectl-curl_*/* |
0 commit comments