From ecb7601714064f2ae9c085643541257b8b1f9c5a Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 3 Dec 2024 18:39:26 +0800 Subject: [PATCH 1/8] fix release pipeline --- .github/workflows/pipeline-release.yml | 52 +++----------------------- CMakeLists.txt | 4 +- tools/pack.sh | 6 +++ 3 files changed, 12 insertions(+), 50 deletions(-) create mode 100644 tools/pack.sh diff --git a/.github/workflows/pipeline-release.yml b/.github/workflows/pipeline-release.yml index 4ac7e129..a0d1a68e 100644 --- a/.github/workflows/pipeline-release.yml +++ b/.github/workflows/pipeline-release.yml @@ -2,66 +2,24 @@ name: Proxy-Release on: workflow_dispatch: - inputs: - version: - description: 'Release version (x.x.x)' - required: true - default: '0.0.0' jobs: - run-bvt-gcc: - name: Run BVT with GCC - uses: ./.github/workflows/bvt-gcc.yml - - run-bvt-clang: - name: Run BVT with Clang - uses: ./.github/workflows/bvt-clang.yml - - run-bvt-msvc: - name: Run BVT with MSVC - uses: ./.github/workflows/bvt-msvc.yml - - run-bvt-appleclang: - name: Run BVT with AppleClang - uses: ./.github/workflows/bvt-appleclang.yml - - run-bvt-nvhpc: - name: Run BVT with NVHPC - uses: ./.github/workflows/bvt-nvhpc.yml - - report: - uses: ./.github/workflows/bvt-report.yml - name: Generate report - needs: [run-bvt-gcc, run-bvt-clang, run-bvt-msvc, run-bvt-appleclang, run-bvt-nvhpc] - draft-release: name: Draft release permissions: contents: write runs-on: ubuntu-24.04 - needs: report steps: - uses: actions/checkout@v4 - - - name: create tag + - name: pack and tag run: | - git checkout -b release/${{ github.event.inputs.version }} - sed -i 's/VERSION 0\.1\.0 # local build version/VERSION ${{ github.event.inputs.version }}/' CMakeLists.txt - git config --local user.email "release-bot@no.email.com" - git config --local user.name "release bot" - git add CMakeLists.txt - git commit -m "Release version ${{ github.event.inputs.version }}" - git tag ${{ github.event.inputs.version }} - git push origin ${{ github.event.inputs.version }} - - - name: create tgz archive - run: tar -czf "proxy-${{ github.event.inputs.version }}.tgz" "proxy.h" + chmod 555 ./tools/pack.sh + ./tools/pack.sh - name: create release draft uses: softprops/action-gh-release@v2 with: draft: true - files: proxy-${{ github.event.inputs.version }}.tgz - name: Proxy ${{ github.event.inputs.version }} Release - tag_name: ${{ github.event.inputs.version }} + files: proxy-*.tgz + name: Proxy Release generate_release_notes: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 51ced73c..078af2a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.5) -project(msft_proxy - VERSION 0.1.0 # local build version - LANGUAGES CXX) +project(msft_proxy VERSION 0.1.0 LANGUAGES CXX) add_library(msft_proxy INTERFACE) target_compile_features(msft_proxy INTERFACE cxx_std_20) target_include_directories(msft_proxy INTERFACE $ diff --git a/tools/pack.sh b/tools/pack.sh new file mode 100644 index 00000000..2ae6c722 --- /dev/null +++ b/tools/pack.sh @@ -0,0 +1,6 @@ +#!/bin/bash +file="CMakeLists.txt" +version=$(grep -oP 'msft_proxy\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' "$file") +git tag "$version" +git push origin "$version" +tar -czf "proxy-$version.tgz" "proxy.h" From 272a155370b5e342c5d1b1c1e6961d47218d1d41 Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 3 Dec 2024 18:47:22 +0800 Subject: [PATCH 2/8] output tag --- .github/workflows/pipeline-release.yml | 4 +++- tools/pack.sh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline-release.yml b/.github/workflows/pipeline-release.yml index a0d1a68e..1e1ca977 100644 --- a/.github/workflows/pipeline-release.yml +++ b/.github/workflows/pipeline-release.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - name: pack and tag + - name: pack source + id: run_pack run: | chmod 555 ./tools/pack.sh ./tools/pack.sh @@ -20,6 +21,7 @@ jobs: uses: softprops/action-gh-release@v2 with: draft: true + tag: ${{ steps.run_pack.outputs.PRO_VER }} files: proxy-*.tgz name: Proxy Release generate_release_notes: true diff --git a/tools/pack.sh b/tools/pack.sh index 2ae6c722..b6413f2e 100644 --- a/tools/pack.sh +++ b/tools/pack.sh @@ -4,3 +4,4 @@ version=$(grep -oP 'msft_proxy\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' "$file") git tag "$version" git push origin "$version" tar -czf "proxy-$version.tgz" "proxy.h" +echo "PRO_VER=$version\n" >> $GITHUB_OUTPUT From 5a0c8a50e3c75b1353e54e2ad396183ba860dbfb Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 3 Dec 2024 18:49:09 +0800 Subject: [PATCH 3/8] tag_name --- .github/workflows/pipeline-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline-release.yml b/.github/workflows/pipeline-release.yml index 1e1ca977..0370fb78 100644 --- a/.github/workflows/pipeline-release.yml +++ b/.github/workflows/pipeline-release.yml @@ -21,7 +21,7 @@ jobs: uses: softprops/action-gh-release@v2 with: draft: true - tag: ${{ steps.run_pack.outputs.PRO_VER }} + tag_name: ${{ steps.run_pack.outputs.PRO_VER }} files: proxy-*.tgz name: Proxy Release generate_release_notes: true From b82c24d3fce75c6c1d101c060370d8994dbfca1b Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 3 Dec 2024 18:53:05 +0800 Subject: [PATCH 4/8] fix --- tools/pack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pack.sh b/tools/pack.sh index b6413f2e..03f12f87 100644 --- a/tools/pack.sh +++ b/tools/pack.sh @@ -4,4 +4,4 @@ version=$(grep -oP 'msft_proxy\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' "$file") git tag "$version" git push origin "$version" tar -czf "proxy-$version.tgz" "proxy.h" -echo "PRO_VER=$version\n" >> $GITHUB_OUTPUT +echo "PRO_VER=$version" >> $GITHUB_OUTPUT From fee0895c08380f2f2a96b45f1fb412f0ded12fd7 Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 3 Dec 2024 19:05:44 +0800 Subject: [PATCH 5/8] improve name --- .github/workflows/pipeline-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline-release.yml b/.github/workflows/pipeline-release.yml index 0370fb78..a0d190ef 100644 --- a/.github/workflows/pipeline-release.yml +++ b/.github/workflows/pipeline-release.yml @@ -23,5 +23,5 @@ jobs: draft: true tag_name: ${{ steps.run_pack.outputs.PRO_VER }} files: proxy-*.tgz - name: Proxy Release + name: Proxy ${{ steps.run_pack.outputs.PRO_VER }} Release generate_release_notes: true From d0dc7b5d7740ae2c8903909889fa24a7cc38c58d Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 3 Dec 2024 19:45:58 +0800 Subject: [PATCH 6/8] run bash --- .github/workflows/pipeline-release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline-release.yml b/.github/workflows/pipeline-release.yml index a0d190ef..ab48cfbc 100644 --- a/.github/workflows/pipeline-release.yml +++ b/.github/workflows/pipeline-release.yml @@ -14,8 +14,13 @@ jobs: - name: pack source id: run_pack run: | - chmod 555 ./tools/pack.sh - ./tools/pack.sh + file="CMakeLists.txt" + version=$(grep -oP 'msft_proxy\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' "$file") + git tag "$version" + git push origin "$version" + tar -czf "proxy-$version.tgz" "proxy.h" + echo "PRO_VER=$version" >> $GITHUB_OUTPUT + shell: bash - name: create release draft uses: softprops/action-gh-release@v2 From 975535ee4ae0c8f39fde7296116be9de6c1070fb Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 3 Dec 2024 19:48:00 +0800 Subject: [PATCH 7/8] remove pack.sh --- tools/pack.sh | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tools/pack.sh diff --git a/tools/pack.sh b/tools/pack.sh deleted file mode 100644 index 03f12f87..00000000 --- a/tools/pack.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -file="CMakeLists.txt" -version=$(grep -oP 'msft_proxy\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' "$file") -git tag "$version" -git push origin "$version" -tar -czf "proxy-$version.tgz" "proxy.h" -echo "PRO_VER=$version" >> $GITHUB_OUTPUT From 0026f667b0c5dd0fd2d0a632a31c54165d54ba35 Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 3 Dec 2024 19:48:57 +0800 Subject: [PATCH 8/8] resolve comment --- .github/workflows/pipeline-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline-release.yml b/.github/workflows/pipeline-release.yml index ab48cfbc..89c5d8a4 100644 --- a/.github/workflows/pipeline-release.yml +++ b/.github/workflows/pipeline-release.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: pack source - id: run_pack + id: run-pack run: | file="CMakeLists.txt" version=$(grep -oP 'msft_proxy\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' "$file") @@ -26,7 +26,7 @@ jobs: uses: softprops/action-gh-release@v2 with: draft: true - tag_name: ${{ steps.run_pack.outputs.PRO_VER }} + tag_name: ${{ steps.run-pack.outputs.PRO_VER }} files: proxy-*.tgz - name: Proxy ${{ steps.run_pack.outputs.PRO_VER }} Release + name: Proxy ${{ steps.run-pack.outputs.PRO_VER }} Release generate_release_notes: true