|
1 |
| -name: Publish release artifacts |
| 1 | +name: release |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - release: |
5 |
| - types: [created] |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
6 | 8 | permissions:
|
7 | 9 | contents: write
|
8 |
| - pull-requests: write |
9 | 10 |
|
10 | 11 | jobs:
|
11 |
| - update_readme: |
12 |
| - name: Update Readme |
13 |
| - runs-on: ubuntu-22.04 |
14 |
| - steps: |
15 |
| - - name: Checkout code |
16 |
| - uses: actions/checkout@v3 |
17 |
| - with: |
18 |
| - fetch-depth: 0 |
19 |
| - ref: main |
20 |
| - - name: Update versions in readme |
21 |
| - run: | |
22 |
| - sed -r -i "s/aws-nuke:v[0-9]+\.[0-9]+\.[0-9]+/aws-nuke:${{ github.ref_name }}/" README.md |
23 |
| - sed -r -i "s/aws-nuke-v[0-9]+\.[0-9]+\.[0-9]+/aws-nuke-${{ github.ref_name }}/" README.md |
24 |
| - sed -r -i "s/\/v[0-9]+\.[0-9]+\.[0-9]+\//\/${{ github.ref_name }}\//" README.md |
25 |
| - - uses: peter-evans/create-pull-request@v5 |
26 |
| - name: Create Pull Request |
27 |
| - with: |
28 |
| - title: Update readme for ${{ github.ref_name }} release |
29 |
| - commit-message: Update readme for ${{ github.ref_name }} release |
30 |
| - body: Updating version references in the readme to ${{ github.ref_name }} |
31 |
| - branch: update-readme-${{ github.ref_name }} |
32 |
| - delete-branch: true |
33 |
| - |
34 |
| - release: |
35 |
| - name: Publish binaries |
36 |
| - runs-on: ubuntu-22.04 |
37 |
| - steps: |
38 |
| - - name: Setup Go |
39 |
| - uses: actions/setup-go@v3 |
40 |
| - with: |
41 |
| - go-version: '1.20' |
42 |
| - - name: Checkout code |
43 |
| - uses: actions/checkout@v3 |
44 |
| - with: |
45 |
| - fetch-depth: 0 |
46 |
| - - name: Build Project binaries |
47 |
| - env: |
48 |
| - CGO_ENABLED: 0 |
49 |
| - run: | |
50 |
| - make xc |
51 |
| - - name: Upload binaries to release |
52 |
| - uses: svenstaro/upload-release-action@v2 |
53 |
| - with: |
54 |
| - repo_token: ${{ secrets.GITHUB_TOKEN }} |
55 |
| - file: dist/aws* |
56 |
| - tag: ${{ github.ref }} |
57 |
| - overwrite: true |
58 |
| - file_glob: true |
59 |
| - |
60 |
| - docker_build: |
61 |
| - runs-on: ubuntu-22.04 |
62 |
| - name: Docker Build |
63 |
| - |
| 12 | + goreleaser: |
| 13 | + runs-on: ubuntu-latest |
64 | 14 | steps:
|
65 |
| - - uses: actions/checkout@v3 |
66 |
| - with: |
67 |
| - fetch-depth: 0 |
68 |
| - |
69 |
| - - name: Generate image tags |
70 |
| - shell: bash |
71 |
| - run: echo "tags=quay.io/rebuy/aws-nuke:${GITHUB_REF#refs/tags/},docker.io/rebuy/aws-nuke:${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT |
72 |
| - id: generate_tags |
73 |
| - |
74 |
| - - name: Set up QEMU |
75 |
| - id: qemu |
76 |
| - uses: docker/setup-qemu-action@v2 |
77 |
| - with: |
78 |
| - platforms: arm64 |
79 |
| - |
80 |
| - - name: Set up Docker Buildx |
81 |
| - uses: docker/setup-buildx-action@v2 |
82 |
| - with: |
83 |
| - install: true |
84 |
| - |
85 |
| - - name: Login to Docker Hub |
86 |
| - uses: docker/login-action@v2 |
87 |
| - with: |
88 |
| - username: ${{ secrets.DOCKER_USERNAME }} |
89 |
| - password: ${{ secrets.DOCKER_PASSWORD }} |
90 |
| - |
91 |
| - - name: Login to Quay.io |
92 |
| - uses: docker/login-action@v2 |
93 |
| - with: |
94 |
| - registry: quay.io |
95 |
| - username: ${{ secrets.QUAY_USERNAME }} |
96 |
| - password: ${{ secrets.QUAY_PASSWORD }} |
97 |
| - |
98 |
| - - name: Build and push |
99 |
| - uses: docker/build-push-action@v3 |
100 |
| - with: |
101 |
| - context: . |
102 |
| - push: true |
103 |
| - tags: ${{ steps.generate_tags.outputs.tags }} |
104 |
| - platforms: linux/amd64,linux/arm64 |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v2 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + - name: Set up Go |
| 20 | + uses: actions/setup-go@v2 |
| 21 | + with: |
| 22 | + go-version: 1.17 |
| 23 | + - name: Run GoReleaser |
| 24 | + uses: goreleaser/goreleaser-action@v2 |
| 25 | + with: |
| 26 | + distribution: goreleaser |
| 27 | + version: latest |
| 28 | + args: release --rm-dist |
| 29 | + env: |
| 30 | + GITHUB_TOKEN: ${{ secrets.RELEASES_GITHUB_TOKEN }} |
0 commit comments