From 08dd4d99f5341005ad79fc8b7bab1cf28cd05c66 Mon Sep 17 00:00:00 2001 From: criyle Date: Sat, 25 Jan 2025 21:10:55 -0500 Subject: [PATCH] build(ci): upload individual artifacts --- .github/workflows/build.yml | 33 ++++++++++++++++++++++++++++++--- .goreleaser.yaml | 2 +- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1084710..64f19ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,8 +14,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Fetch all tags - run: git fetch --force --tags - name: Login to DockerHub uses: docker/login-action@v3 with: @@ -50,4 +48,33 @@ jobs: uses: actions/upload-artifact@v4 with: name: go-judge - path: dist/* + path: dist/ + upload-artifacts: + name: Upload artifacts-${{ matrix.os }}-${{ matrix.arch }} + runs-on: ubuntu-latest + strategy: + matrix: + os: + - windows + - linux + - darwin + arch: + - amd64_v3 + - arm64_v8.0 + steps: + - uses: actions/download-artifact@v4 + with: + name: go-judge + path: dist + - name: Upload assets go-judge + uses: actions/upload-artifact@v4 + with: + name: go-judge_${{ matrix.os == 'darwin' && 'macos' || matrix.os }}_${{ matrix.arch }} + path: dist/go-judge_${{ matrix.os }}_${{ matrix.arch }}/go-judge${{ matrix.os == 'windows' && '.exe'}} + - name: Upload assets go-judge-shell + uses: actions/upload-artifact@v4 + with: + name: go-judge-shell_${{ matrix.os == 'darwin' && 'macos' || matrix.os }}_${{ matrix.arch }} + path: dist/go-judge-shell_${{ matrix.os }}_${{ matrix.arch }}/go-judge-shell${{ matrix.os == 'windows' && '.exe'}} + + diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3d01478..1277ead 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -109,7 +109,7 @@ archives: - mount.yaml formats: [ 'binary', 'tar.gz' ] name_template: >- - {{ .ProjectName }}_{{ .Version }}_ + {{ .Binary }}_{{ .Version }}_ {{- if eq .Os "darwin" }}macOS {{- else }}{{ .Os }}{{ end }}_{{ .Arch }} {{- with .Arm }}v{{ . }}{{ end }}