Skip to content

Commit

Permalink
fix: workflows错误
Browse files Browse the repository at this point in the history
  • Loading branch information
fishros committed Sep 15, 2024
1 parent e9706ff commit 99a6b37
Showing 1 changed file with 46 additions and 34 deletions.
80 changes: 46 additions & 34 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ github.run_number }}-${{ github.sha }}
name: build-artifacts-linux-${{ github.run_number }}-${{ github.sha }}
path: dist

- name: Copy Bin
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Archive build artifacts bin
uses: actions/upload-artifact@v4
with:
name: build-artifacts-linux-amd64-${{ github.run_number }}-${{ github.sha }}
name: build-artifacts-linux-bin-${{ github.run_number }}-${{ github.sha }}
path: dist-bin


Expand Down Expand Up @@ -72,8 +72,6 @@ jobs:
name: build-artifacts-cli-${{ github.run_number }}-${{ github.sha }}
path: dist



build-release-docker:
runs-on: ubuntu-latest
needs: [build-linux-amd64]
Expand All @@ -84,7 +82,7 @@ jobs:
- name: Download built artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-release-docker-${{ github.run_number }}-${{ github.sha }}-for-docker
name: build-artifacts-linux-bin-${{ github.run_number }}-${{ github.sha }}
path: ./dist-for-docker

- name: Docker login
Expand All @@ -97,32 +95,46 @@ jobs:
run: /bin/bash release_docker.sh

release:
runs-on: ubuntu-22.04
needs: [build-release-docker, build-windows, build-cli-version]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download built artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-release-${{ github.run_number }}-${{ github.sha }}
path: ./dist

- name: Update release notes
run: |
echo "sed -i 's/DOCKER-TAG/$GITHUB_REF_NAME/g' ./release-notes.md" > change_tag.sh
/bin/bash change_tag.sh
- name: Create Release and Upload Release Asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ env.REF_NAME }}
name: ${{ env.REF_NAME }}
body_path: release-notes.md
token: ${{ secrets.ACCESS_TOKEN }}
draft: false
prerelease: false
files: |
dist/*
runs-on: ubuntu-22.04
needs: [build-release-docker, build-windows, build-cli-version]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-linux-bin-${{ github.run_number }}-${{ github.sha }}
path: ./dist/linux

- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-windows-${{ github.run_number }}-${{ github.sha }}
path: ./dist/windows

- name: Download CLI artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-cli-${{ github.run_number }}-${{ github.sha }}
path: ./dist/cli

- name: Update release notes
run: |
echo "sed -i 's/DOCKER-TAG/$GITHUB_REF_NAME/g' ./release-notes.md" > change_tag.sh
/bin/bash change_tag.sh
- name: Create Release and Upload Release Asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body_path: release-notes.md
token: ${{ secrets.ACCESS_TOKEN }}
draft: false
prerelease: false
files: |
dist/linux/*
dist/windows/*
dist/cli/*

0 comments on commit 99a6b37

Please sign in to comment.