■ ■ ■ ■ ■ ■
.github/workflows/release.yml
1 | | - | #name: Release |
2 | | - | # |
3 | | - | #on: |
4 | | - | # push: |
5 | | - | # tags: |
6 | | - | # - 'v*' |
7 | | - | # |
8 | | - | #jobs: |
9 | | - | # binary: |
10 | | - | # name: release binary files |
11 | | - | # runs-on: ubuntu-latest |
12 | | - | # steps: |
13 | | - | # - name: Set up Go 1.x |
14 | | - | # uses: actions/setup-go@v2 |
15 | | - | # with: |
16 | | - | # go-version: ^1.18 |
17 | | - | # |
18 | | - | # - name: Checkout |
19 | | - | # uses: actions/checkout@v2 |
20 | | - | # |
21 | | - | # - name: Build |
22 | | - | # run: | |
23 | | - | # bash build.sh ${GITHUB_REF##*/} |
24 | | - | # |
25 | | - | # - name: release |
26 | | - | # env: |
27 | | - | # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
28 | | - | # run: | |
29 | | - | # set -x |
30 | | - | # assets=() |
31 | | - | # for asset in targets/*; do |
32 | | - | # assets+=("-a" "$asset") |
33 | | - | # done |
34 | | - | # tag_name="${GITHUB_REF##*/}" |
35 | | - | # hub release create "${assets[@]}" -m "$tag_name" "$tag_name" |
36 | | - | # |
37 | | - | # docker: |
38 | | - | # name: Release Docker |
39 | | - | # runs-on: ubuntu-latest |
40 | | - | # steps: |
41 | | - | # - name: Checkout |
42 | | - | # uses: actions/checkout@v2 |
43 | | - | # |
44 | | - | # - name: Dockerhub login |
45 | | - | # env: |
46 | | - | # DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |
47 | | - | # run: | |
48 | | - | # echo "${DOCKER_PASSWORD}" | docker login --username luyuhuang --password-stdin |
49 | | - | # |
50 | | - | # - name: Set up QEMU |
51 | | - | # uses: docker/setup-qemu-action@v1 |
52 | | - | # |
53 | | - | # - name: Set up Docker Buildx |
54 | | - | # id: buildx |
55 | | - | # uses: docker/setup-buildx-action@v1 |
56 | | - | # with: |
57 | | - | # version: latest |
58 | | - | # |
59 | | - | # - name: Build dockerfile (with push) |
60 | | - | # run: | |
61 | | - | # docker buildx build \ |
62 | | - | # --platform=linux/amd64,linux/arm/v7,linux/arm64 \ |
63 | | - | # --output "type=image,push=true" \ |
64 | | - | # --build-arg VERSION=${GITHUB_REF##*/} \ |
65 | | - | # --file ./mainfest/Dockerfile . \ |
66 | | - | # --tag dvkunion/seamoon:latest \ |
67 | | - | # --tag dvkunion/seamoon:${GITHUB_REF##*/} |
| 1 | + | name: goreleaser |
| 2 | + | |
| 3 | + | on: |
| 4 | + | push: |
| 5 | + | tags: |
| 6 | + | - "*" |
| 7 | + | |
| 8 | + | jobs: |
| 9 | + | build: |
| 10 | + | name: GoReleaser build |
| 11 | + | runs-on: ubuntu-latest |
| 12 | + | steps: |
| 13 | + | - name: Checkout |
| 14 | + | uses: actions/checkout@v2 |
| 15 | + | with: |
| 16 | + | fetch-depth: 0 |
| 17 | + | |
| 18 | + | - name: Set up Go |
| 19 | + | uses: actions/setup-go@v2 |
| 20 | + | with: |
| 21 | + | go-version: 1.18 |
| 22 | + | id: go |
| 23 | + | |
| 24 | + | - name: Run GoReleaser |
| 25 | + | uses: goreleaser/goreleaser-action@v2 |
| 26 | + | with: |
| 27 | + | distribution: goreleaser |
| 28 | + | version: latest |
| 29 | + | args: -f .github/conf/.goreleaser.yml |
| 30 | + | workdir: . |
| 31 | + | env: |
| 32 | + | GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }} |
68 | 33 | | |