fix: build+package в одной джобе (upload-artifact несовместим с Gitea)
All checks were successful
build-test / build (push) Successful in 38s
All checks were successful
build-test / build (push) Successful in 38s
This commit is contained in:
@@ -31,7 +31,8 @@ jobs:
|
|||||||
- name: Vet
|
- name: Vet
|
||||||
run: go vet ./...
|
run: go vet ./...
|
||||||
|
|
||||||
build:
|
build-and-package:
|
||||||
|
if: always()
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -45,21 +46,8 @@ jobs:
|
|||||||
- name: Build binary
|
- name: Build binary
|
||||||
run: go build -ldflags="-s -w" -o ratatoskr ./cmd/ratatoskr/
|
run: go build -ldflags="-s -w" -o ratatoskr ./cmd/ratatoskr/
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ratatoskr
|
|
||||||
path: ratatoskr
|
|
||||||
|
|
||||||
package:
|
|
||||||
if: gitea.ref == 'refs/heads/main'
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ratatoskr
|
|
||||||
|
|
||||||
- name: Upload to Gitea Packages
|
- name: Upload to Gitea Packages
|
||||||
|
if: gitea.ref == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
VERSION="commit-$(echo '${{ gitea.sha }}' | cut -c1-7)"
|
VERSION="commit-$(echo '${{ gitea.sha }}' | cut -c1-7)"
|
||||||
curl -sS -X PUT \
|
curl -sS -X PUT \
|
||||||
@@ -70,10 +58,15 @@ jobs:
|
|||||||
echo "Uploaded version ${VERSION}"
|
echo "Uploaded version ${VERSION}"
|
||||||
|
|
||||||
- name: Update latest tag
|
- name: Update latest tag
|
||||||
|
if: gitea.ref == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
curl -sS -X PUT \
|
curl -sS -X PUT \
|
||||||
-H "Authorization: token ${{ secrets.TC_GITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.TC_GITEA_TOKEN }}" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
"${{ vars.GIT_MAIN_URL }}/api/packages/${{ gitea.actor }}/generic/ratatoskr/latest/ratatoskr" \
|
"${{ vars.GIT_MAIN_URL }}/api/packages/${{ gitea.actor }}/generic/ratatoskr/latest/ratatoskr" \
|
||||||
--data-binary @ratatoskr
|
--data-binary @ratatoskr
|
||||||
echo "Updated 'latest' tag"
|
echo "Updated 'latest' tag"
|
||||||
|
|
||||||
|
- name: Store binary (PR only)
|
||||||
|
if: gitea.ref != 'refs/heads/main'
|
||||||
|
run: ls -lh ratatoskr
|
||||||
Reference in New Issue
Block a user