Skip to content

Commit 4122f7b

Browse files
committed
chore(release): upload assets to artifact
1 parent 1707cb3 commit 4122f7b

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ jobs:
3434
with:
3535
fetch-depth: 0
3636

37+
- name: Init tag version name
38+
run: |
39+
echo "TAG_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
40+
3741
- name: Log in to Docker Hub
3842
uses: docker/login-action@v3
3943
with:
@@ -50,3 +54,10 @@ jobs:
5054
GITHUB_TOKEN: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
5155
DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }}
5256
DOCKERHUB_REPOSITORY: ${{ vars.DOCKERHUB_REPOSITORY }}
57+
TAG_VERSION: ${{ env.TAG_VERSION }}
58+
59+
- name: Upload assets
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: go-qris
63+
path: ./dist/*

deployments/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM scratch
22

3-
# file binary file
3+
# Copy compiled binary into the container
44
COPY go-qris /go-qris
55

6-
# run the server executable
6+
# Set default command to run application
77
ENTRYPOINT ["/go-qris","run"]

deployments/goreleaser.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ builds:
2424
- amd64
2525

2626
archives:
27-
- name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
27+
- name_template: "{{ .ProjectName }}-{{ .Env.TAG_VERSION }}-{{ .Os }}-{{ .Arch }}"
2828
format_overrides:
2929
- goos: windows
3030
format: zip
@@ -34,13 +34,13 @@ archives:
3434

3535
dockers:
3636
- image_templates:
37-
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Tag }}-amd64"
37+
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Env.TAG_VERSION }}-amd64"
3838
use: buildx
3939
dockerfile: ./deployments/Dockerfile
4040
build_flag_templates:
4141
- "--platform=linux/amd64"
4242
- image_templates:
43-
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Tag }}-arm64"
43+
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Env.TAG_VERSION }}-arm64"
4444
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:latest"
4545
use: buildx
4646
dockerfile: ./deployments/Dockerfile
@@ -49,14 +49,14 @@ dockers:
4949
- --platform=linux/arm64/v8
5050

5151
docker_manifests:
52-
- name_template: "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Tag }}"
52+
- name_template: "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Env.TAG_VERSION }}"
5353
image_templates:
54-
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Tag }}-amd64"
55-
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Tag }}-arm64"
54+
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Env.TAG_VERSION }}-amd64"
55+
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Env.TAG_VERSION }}-arm64"
5656
- name_template: "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:latest"
5757
image_templates:
58-
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Tag }}-amd64"
59-
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Tag }}-arm64"
58+
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Env.TAG_VERSION }}-amd64"
59+
- "docker.io/{{ .Env.DOCKERHUB_USERNAME }}/{{ .Env.DOCKERHUB_REPOSITORY }}:{{ .Env.TAG_VERSION }}-arm64"
6060

6161
changelog:
6262
sort: asc

0 commit comments

Comments
 (0)