Skip to content

Commit

Permalink
fix: build tag and version error (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
DVKunion authored Apr 2, 2024
1 parent edddb49 commit f7de6a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/conf/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ builds:
- 6
- 7
ldflags:
- -s -w -X github.com/DVKunion/SeaMoon/system/xlog.Version={{.Version}} -X github.com/DVKunion/SeaMoon/system/xlog.Commit={{.ShortCommit}}
- -s -w -X github.com/DVKunion/SeaMoon/pkg/system/xlog.Version={{.Version}} -X github.com/DVKunion/SeaMoon/pkg/system/xlog.Commit={{.ShortCommit}}
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
run: |
skopeo sync --src docker --dest docker --dest-creds ${{ secrets.ALIYUN_USERNAME }}:${{ secrets.ALIYUN_PASSWORD }} docker.io/dvkunion/seamoon:${{github.ref_name}} ${{ matrix.registry }}/${{ matrix.repo }}
skopeo sync --src docker --dest docker --dest-creds ${{ secrets.ALIYUN_USERNAME }}:${{ secrets.ALIYUN_PASSWORD }} docker.io/dvkunion/seamoon:latest ${{ matrix.registry }}/${{ matrix.repo }}
package-tencent:
name: package-tecent
runs-on: ubuntu-20.04
Expand All @@ -65,12 +64,19 @@ jobs:
uswccr.ccs.tencentyun.com
]
repo: [seamoon]
include:
- registry: ccr.ccs.tencentyun.com
repo: [dvkunion]
steps:
- uses: actions/checkout@v4
- name: skopeo-copy
run: |
skopeo sync --src docker --dest docker --dest-creds ${{ secrets.TENCENT_USERNAME }}:${{ secrets.TENCENT_PASSWORD }} docker.io/dvkunion/seamoon:${{github.ref_name}} ${{ matrix.registry }}/${{ matrix.repo }}
skopeo sync --src docker --dest docker --dest-creds ${{ secrets.TENCENT_USERNAME }}:${{ secrets.TENCENT_PASSWORD }} docker.io/dvkunion/seamoon:latest ${{ matrix.registry }}/${{ matrix.repo }}
package-tencent-inbound:
name: package-tecent-inbound
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: skopeo-copy
run: |
skopeo sync --src docker --dest docker --dest-creds ${{ secrets.TENCENT_USERNAME }}:${{ secrets.TENCENT_PASSWORD }} docker.io/dvkunion/seamoon:${{github.ref_name}} ccr.ccs.tencentyun.com/dvkunion
skopeo sync --src docker --dest docker --dest-creds ${{ secrets.TENCENT_USERNAME }}:${{ secrets.TENCENT_PASSWORD }} docker.io/dvkunion/seamoon:latest ccr.ccs.tencentyun.com/dvkunion
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /src
ENV CGO_ENABLED 0
ENV VERSION=${VERSION}
ENV SHA=${SHA}
RUN go build -v -ldflags "-X github.com/DVKunion/SeaMoon/system/xlog.Version=${VERSION} -X github.com/DVKunion/SeaMoon/system/xlog.Commit=${SHA}" -o /tmp/seamoon cmd/main.go
RUN go build -v -ldflags "-X github.com/DVKunion/SeaMoon/pkg/system/xlog.Version=${VERSION} -X github.com/DVKunion/SeaMoon/pkg/system/xlog.Commit=${SHA}" -o /tmp/seamoon cmd/main.go
RUN chmod +x /tmp/seamoon
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
apk add upx && upx -9 /tmp/seamoon
Expand Down

0 comments on commit f7de6a0

Please sign in to comment.