From fd8e4adbaacdc651d00db75c47bc0088a917c35f Mon Sep 17 00:00:00 2001 From: Jiaqi Luo <6218999+jiaqiluo@users.noreply.github.com> Date: Mon, 1 Jul 2024 13:16:30 -0700 Subject: [PATCH] add the step for creating GH release, and fix typo in filename --- ...l-requset.yaml => ci-on-pull-request.yaml} | 0 .github/workflows/release.yaml | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+) rename .github/workflows/{ci-on-pull-requset.yaml => ci-on-pull-request.yaml} (100%) diff --git a/.github/workflows/ci-on-pull-requset.yaml b/.github/workflows/ci-on-pull-request.yaml similarity index 100% rename from .github/workflows/ci-on-pull-requset.yaml rename to .github/workflows/ci-on-pull-request.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 346b13c1..463685a9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -264,3 +264,41 @@ jobs: run: | docker buildx imagetools inspect ${{ env.IMAGE }}:${{ env.TAG_SUC }} + github_release: + runs-on: ubuntu-latest + needs: + - merge + - merge-suc + permissions: + contents: write # needed for creating the GH release + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download binary + uses: actions/download-artifact@v4 + with: + pattern: binary-* + path: bin + + - name: Prepare release + run: | + mkdir tmp + for DIR in bin/binary-*; do + if [[ -d "$DIR" && -f "$DIR/rancher-system-agent" ]]; then + ARCH=$(echo "$DIR" | awk -F'-' '{print $NF}') + mv "$DIR/rancher-system-agent" "tmp/rancher-system-agent-$ARCH" + fi + done + cp install.sh system-agent-uninstall.sh tmp + mkdir dist + for file in tmp/*; do + sha256sum "$file" >> dist/sha256sum.txt + done + mv tmp/* dist + + - name: Create release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: + gh release create ${{ github.ref_name }} --verify-tag --generate-notes dist/*