From 1b9444de4948681590e49e6ec0e8eb549d7876cf Mon Sep 17 00:00:00 2001 From: Sam Hou Date: Sat, 22 Feb 2025 17:32:09 +0800 Subject: [PATCH 1/5] ci: :construction_worker: Create dotnet-release --- .github/workflows/create-release.yml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/create-release.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..b053cb7 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,38 @@ +name: Create Release on Tag Push +env: + PUBLISH_PATH: "./publish" +on: + push: + tags: + - '*' # On tag push + +jobs: + create_release: + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Publish + run: dotnet publish --output '${{ env.PUBLISH_PATH }}' + - name: Set up gh CLI + run: | + gh --version + gh auth status + gh auth setup-git + - name: Compress Artifact + - name: Compress release artifact + run: 7z a AI.NET.zip $env.PUBLISH_PATH + - name: Create Release using gh CLI + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create ${{ github.ref_name }} \ + --title "Release ${{ github.ref_name }}" \ + --generate-notes + gh release upload ${{ github.ref_name }} AI.NET.zip From 2388d67ce4ede33059ba19282289650a86cb2bc3 Mon Sep 17 00:00:00 2001 From: Sam Hou Date: Sat, 22 Feb 2025 17:38:17 +0800 Subject: [PATCH 2/5] Update create-release.yml --- .github/workflows/create-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index b053cb7..1f15ef5 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -25,7 +25,6 @@ jobs: gh --version gh auth status gh auth setup-git - - name: Compress Artifact - name: Compress release artifact run: 7z a AI.NET.zip $env.PUBLISH_PATH - name: Create Release using gh CLI From 207167d1dad07352943fdcb3f36eca351d894ff2 Mon Sep 17 00:00:00 2001 From: Sam Hou Date: Sat, 22 Feb 2025 17:48:46 +0800 Subject: [PATCH 3/5] Update create-release.yml --- .github/workflows/create-release.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 1f15ef5..a5d00b4 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -1,6 +1,7 @@ name: Create Release on Tag Push env: PUBLISH_PATH: "./publish" + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} on: push: tags: @@ -20,16 +21,9 @@ jobs: dotnet-version: 8.0.x - name: Publish run: dotnet publish --output '${{ env.PUBLISH_PATH }}' - - name: Set up gh CLI - run: | - gh --version - gh auth status - gh auth setup-git - name: Compress release artifact run: 7z a AI.NET.zip $env.PUBLISH_PATH - name: Create Release using gh CLI - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create ${{ github.ref_name }} \ --title "Release ${{ github.ref_name }}" \ From 7817dbf308ff197a6b3ccdd1018c8d02b284e30d Mon Sep 17 00:00:00 2001 From: Sam Hou Date: Sat, 22 Feb 2025 17:56:57 +0800 Subject: [PATCH 4/5] Update create-release.yml --- .github/workflows/create-release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index a5d00b4..bd8ff9a 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -22,10 +22,8 @@ jobs: - name: Publish run: dotnet publish --output '${{ env.PUBLISH_PATH }}' - name: Compress release artifact - run: 7z a AI.NET.zip $env.PUBLISH_PATH + run: 7z a AI.NET.zip ${{ env.PUBLISH_PATH }} - name: Create Release using gh CLI run: | - gh release create ${{ github.ref_name }} \ - --title "Release ${{ github.ref_name }}" \ - --generate-notes + gh release create ${{ github.ref_name }} --title "Release ${{ github.ref_name }}" --generate-notes gh release upload ${{ github.ref_name }} AI.NET.zip From 15ba43cc93a256a4761e63d98a8f739ed3ced382 Mon Sep 17 00:00:00 2001 From: Sam Hou Date: Sat, 22 Feb 2025 18:08:36 +0800 Subject: [PATCH 5/5] Update create-release.yml --- .github/workflows/create-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index bd8ff9a..7850c0d 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -6,7 +6,8 @@ on: push: tags: - '*' # On tag push - +permissions: + contents: write jobs: create_release: runs-on: windows-latest