Skip to content

Commit a0a18f6

Browse files
committed
release build
1 parent 5a8f9f3 commit a0a18f6

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/xtracfg.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,17 @@ jobs:
224224
- name: log2
225225
run: |
226226
ls -lR
227+
- name: release-github
228+
#if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
229+
env:
230+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
231+
run: |
232+
tar -czvf xtracfg_${{ github.ref_name }}_linux_amd64.tar.gz -C ./xtracfg-linux-amd64 xtracfg
233+
tar -czvf xtracfg_${{ github.ref_name }}_linux_arm64.tar.gz -C ./xtracfg-linux-arm64 xtracfg
234+
tar -czvf xtracfg_${{ github.ref_name }}_macos_arm64.tar.gz -C ./xtracfg-darwin-arm64 xtracfg
235+
gh release upload ${{ github.ref_name }} xtracfg_${{ github.ref_name }}_linux_amd64.tar.gz
236+
gh release upload ${{ github.ref_name }} xtracfg_${{ github.ref_name }}_linux_arm64.tar.gz
237+
gh release upload ${{ github.ref_name }} xtracfg_${{ github.ref_name }}_macos_arm64.tar.gz
227238
- uses: bhowell2/github-substring-action@1.0.2
228239
id: short-sha
229240
with:

.github/workflows/xtractl.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
#git config --global --add safe.directory $GITHUB_WORKSPACE
2828
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/linux-amd64/xtractl -ldflags="-s -w -X ${CMD_GIT_TAG} -X ${CMD_GIT_SHA} -X ${CMD_GIT_BRANCH}"
2929
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/linux-arm64/xtractl -ldflags="-s -w -X ${CMD_GIT_TAG} -X ${CMD_GIT_SHA} -X ${CMD_GIT_BRANCH}"
30+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o dist/darwin-arm64/xtractl -ldflags="-s -w -X ${CMD_GIT_TAG} -X ${CMD_GIT_SHA} -X ${CMD_GIT_BRANCH}"
3031
cp Dockerfile dist/
3132
- name: log1
3233
run: |
@@ -46,19 +47,20 @@ jobs:
4647
name: dist
4748
path: ./xtractl/dist
4849
retention-days: 1
49-
- name: release
50+
- name: release-github
5051
#if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
5152
working-directory: ./xtractl/dist
5253
env:
5354
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5455
run: |
55-
chmod +x ./linux-amd64/xtractl
56-
chmod +x ./linux-arm64/xtractl
56+
chmod +x ./*/xtractl
5757
tar -czvf xtractl_${{ github.ref_name }}_linux_amd64.tar.gz -C ./linux-amd64 xtractl
5858
tar -czvf xtractl_${{ github.ref_name }}_linux_arm64.tar.gz -C ./linux-arm64 xtractl
59+
tar -czvf xtractl_${{ github.ref_name }}_macos_arm64.tar.gz -C ./darwin-arm64 xtractl
5960
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft
6061
gh release upload ${{ github.ref_name }} xtractl_${{ github.ref_name }}_linux_amd64.tar.gz
6162
gh release upload ${{ github.ref_name }} xtractl_${{ github.ref_name }}_linux_arm64.tar.gz
63+
gh release upload ${{ github.ref_name }} xtractl_${{ github.ref_name }}_macos_arm64.tar.gz
6264
6365
docker:
6466
runs-on: ubuntu-latest
@@ -100,6 +102,7 @@ jobs:
100102
if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}
101103
uses: docker/build-push-action@v6
102104
with:
105+
context: .
103106
push: true
104107
pull: true
105108
tags: |
@@ -112,6 +115,7 @@ jobs:
112115
if: ${{ github.ref_type == 'branch' && github.ref_name != 'main' }}
113116
uses: docker/build-push-action@v6
114117
with:
118+
context: .
115119
push: true
116120
pull: true
117121
tags: |
@@ -124,6 +128,7 @@ jobs:
124128
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
125129
uses: docker/build-push-action@v6
126130
with:
131+
context: .
127132
push: true
128133
pull: true
129134
tags: |

0 commit comments

Comments
 (0)