From 24985812b12116d9a297eded5cd80426007ba595 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 03:30:32 +0200 Subject: [PATCH 01/22] Add .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..048089e --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,52 @@ +version: '1' +name: Release Version + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.23.1' + + - name: Build Go binary + run: | + go mod tidy + go build -o s3-client + + - name: Create release version + id: create_version + run: | + latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") + new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') + echo "new_version=$new_version" >> $GITHUB_ENV + + git tag $new_version + git push origin $new_version + + - name: Create Release + uses: actions/create-release@v1 + with: + tag_name: ${{ env.new_version }} + release_name: Release ${{ env.new_version }} + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + + - name: Upload Go binary to release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_version.outputs.upload_url }} + asset_path: ./myapp + asset_name: myapp_${{ env.new_version }}_linux_amd64 + asset_content_type: application/octet-stream From abdc5486e539c4c42331b5c49a8c9e2a661fa951 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 03:36:12 +0200 Subject: [PATCH 02/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 048089e..2ecf57d 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -46,7 +46,7 @@ jobs: - name: Upload Go binary to release uses: actions/upload-release-asset@v1 with: - upload_url: ${{ steps.create_version.outputs.upload_url }} - asset_path: ./myapp - asset_name: myapp_${{ env.new_version }}_linux_amd64 + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./s3-client + asset_name: s3-client_${{ env.new_version }}_linux_amd64 asset_content_type: application/octet-stream From 11af0e86f90bb10568d70803c09e9ff1091d8b9c Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 03:42:53 +0200 Subject: [PATCH 03/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 2ecf57d..966f6dd 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -33,11 +33,21 @@ jobs: git tag $new_version git push origin $new_version + - name: Get latest commit ID + id: get_commit + run: | + commit_id=$(git rev-parse HEAD) + echo "commit_id=$commit_id" >> $GITHUB_ENV + - name: Create Release uses: actions/create-release@v1 with: tag_name: ${{ env.new_version }} release_name: Release ${{ env.new_version }} + release_description: | + Automatic release by Gitea CI + Release version ${{ env.new_version }}. + Commit ID: ${{ env.commit_id }} draft: false prerelease: false env: From 313c8822cb693a2448a2379b47bc157d4c865245 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 03:47:23 +0200 Subject: [PATCH 04/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 966f6dd..b96bfd4 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -23,22 +23,28 @@ jobs: go mod tidy go build -o s3-client - - name: Create release version - id: create_version - run: | - latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") - new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') - echo "new_version=$new_version" >> $GITHUB_ENV - - git tag $new_version - git push origin $new_version - - name: Get latest commit ID id: get_commit run: | commit_id=$(git rev-parse HEAD) echo "commit_id=$commit_id" >> $GITHUB_ENV + - name: Get latest version and increment + id: create_version + run: | + latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") + new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') + + if git rev-parse "$new_version" >/dev/null 2>&1; then + echo "Tag $new_version already exists. Exiting." + exit 1 + fi + + echo "new_version=$new_version" >> $GITHUB_ENV + + git tag $new_version + git push origin $new_version + - name: Create Release uses: actions/create-release@v1 with: From 3addae5a1404106ee60565b0eafdd484dfcb884e Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 03:51:20 +0200 Subject: [PATCH 05/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index b96bfd4..61ece65 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -35,6 +35,7 @@ jobs: latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') + # Sprawdzenie, czy nowy tag już istnieje if git rev-parse "$new_version" >/dev/null 2>&1; then echo "Tag $new_version already exists. Exiting." exit 1 @@ -46,6 +47,7 @@ jobs: git push origin $new_version - name: Create Release + id: create_release uses: actions/create-release@v1 with: tag_name: ${{ env.new_version }} @@ -59,10 +61,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.TOKEN }} + - name: Save release URL + run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV + - name: Upload Go binary to release uses: actions/upload-release-asset@v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} + upload_url: ${{ env.upload_url }} asset_path: ./s3-client asset_name: s3-client_${{ env.new_version }}_linux_amd64 asset_content_type: application/octet-stream From 5afa02c2877d9ee66593bb2b6cb23f828b76136a Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 03:55:52 +0200 Subject: [PATCH 06/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 61ece65..1e672be 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -59,7 +59,7 @@ jobs: draft: false prerelease: false env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} + GITEA_TOKEN: ${{ secrets.TOKEN }} - name: Save release URL run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV From 81646c5bdb8d4f28bd339444d4f3f9dfecc002af Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 03:57:29 +0200 Subject: [PATCH 07/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 1e672be..e6a0c11 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -60,6 +60,7 @@ jobs: prerelease: false env: GITEA_TOKEN: ${{ secrets.TOKEN }} + GITHUB_TOKEN: ${{ secrets.TOKEN }} - name: Save release URL run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV From 723ba2c8ca1cc3c932f0d968594f26f8409b135b Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:01:05 +0200 Subject: [PATCH 08/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index e6a0c11..440b89b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -35,7 +35,6 @@ jobs: latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') - # Sprawdzenie, czy nowy tag już istnieje if git rev-parse "$new_version" >/dev/null 2>&1; then echo "Tag $new_version already exists. Exiting." exit 1 @@ -72,3 +71,6 @@ jobs: asset_path: ./s3-client asset_name: s3-client_${{ env.new_version }}_linux_amd64 asset_content_type: application/octet-stream + env: + GITEA_TOKEN: ${{ secrets.TOKEN }} + GITHUB_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file From cf8285f45cc3bd129dd286a0f790c1242c2f9243 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:03:07 +0200 Subject: [PATCH 09/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 440b89b..60add3b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -70,7 +70,4 @@ jobs: upload_url: ${{ env.upload_url }} asset_path: ./s3-client asset_name: s3-client_${{ env.new_version }}_linux_amd64 - asset_content_type: application/octet-stream - env: - GITEA_TOKEN: ${{ secrets.TOKEN }} - GITHUB_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file + asset_content_type: application/octet-stream \ No newline at end of file From 4efbefe8e6c27c1bafdd579ec1e1b2d144384db3 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:06:39 +0200 Subject: [PATCH 10/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 60add3b..4171aff 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -58,8 +58,8 @@ jobs: draft: false prerelease: false env: - GITEA_TOKEN: ${{ secrets.TOKEN }} - GITHUB_TOKEN: ${{ secrets.TOKEN }} + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} - name: Save release URL run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV From c61c89f025a3fb9f6c278ca90fca7f4c0019ef56 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:09:45 +0200 Subject: [PATCH 11/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 4171aff..43f646b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -58,8 +58,8 @@ jobs: draft: false prerelease: false env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITEA_TOKEN: ${{ secrets.GL_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GL_TOKEN }} - name: Save release URL run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV From b48706fa9c542fa766f1c6ea03f9a1d17ce7e3d1 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:15:22 +0200 Subject: [PATCH 12/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 43f646b..fc74a15 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -58,8 +58,8 @@ jobs: draft: false prerelease: false env: - GITEA_TOKEN: ${{ secrets.GL_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GL_TOKEN }} + GITEA_TOKEN: ${{ secrets.GITEA_GL_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITEA_GL_TOKEN }} - name: Save release URL run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV From a713e7ddd836b6789848abd669cc3a7b45bfade9 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:16:34 +0200 Subject: [PATCH 13/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index fc74a15..43f646b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -58,8 +58,8 @@ jobs: draft: false prerelease: false env: - GITEA_TOKEN: ${{ secrets.GITEA_GL_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITEA_GL_TOKEN }} + GITEA_TOKEN: ${{ secrets.GL_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GL_TOKEN }} - name: Save release URL run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV From de5220eec4d781e89068cf65c95e4850a767a125 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:19:23 +0200 Subject: [PATCH 14/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 43f646b..64953e6 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -58,12 +58,15 @@ jobs: draft: false prerelease: false env: - GITEA_TOKEN: ${{ secrets.GL_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GL_TOKEN }} + GITEA_TOKEN: ${{ secrets.TOKEN }} + GITHUB_TOKEN: ${{ secrets.TOKEN }} - name: Save release URL run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV + - name: List files in current directory + run: ls -la + - name: Upload Go binary to release uses: actions/upload-release-asset@v1 with: From db2b5ca8337a8def70e728199b0e070e3f74b2c8 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:24:02 +0200 Subject: [PATCH 15/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 64953e6..e1cc58d 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -21,13 +21,13 @@ jobs: - name: Build Go binary run: | go mod tidy - go build -o s3-client + go build -o s3-client - name: Get latest commit ID id: get_commit run: | commit_id=$(git rev-parse HEAD) - echo "commit_id=$commit_id" >> $GITHUB_ENV + echo "commit_id=$commit_id" >> $GITHUB_ENV - name: Get latest version and increment id: create_version @@ -43,7 +43,7 @@ jobs: echo "new_version=$new_version" >> $GITHUB_ENV git tag $new_version - git push origin $new_version + git push origin $new_version - name: Create Release id: create_release @@ -54,7 +54,7 @@ jobs: release_description: | Automatic release by Gitea CI Release version ${{ env.new_version }}. - Commit ID: ${{ env.commit_id }} + Commit ID: ${{ env.commit_id }} draft: false prerelease: false env: @@ -64,13 +64,13 @@ jobs: - name: Save release URL run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV - - name: List files in current directory - run: ls -la - - name: Upload Go binary to release uses: actions/upload-release-asset@v1 with: upload_url: ${{ env.upload_url }} asset_path: ./s3-client asset_name: s3-client_${{ env.new_version }}_linux_amd64 - asset_content_type: application/octet-stream \ No newline at end of file + asset_content_type: application/octet-stream + env: + GITEA_TOKEN: ${{ secrets.TOKEN }} + GITHUB_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file From e555b41431c262f2cedc0715f6bdf4648472215a Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:30:23 +0200 Subject: [PATCH 16/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index e1cc58d..da5585c 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -65,12 +65,8 @@ jobs: run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV - name: Upload Go binary to release - uses: actions/upload-release-asset@v1 + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ env.upload_url }} - asset_path: ./s3-client - asset_name: s3-client_${{ env.new_version }}_linux_amd64 - asset_content_type: application/octet-stream + files: ./s3-client env: - GITEA_TOKEN: ${{ secrets.TOKEN }} GITHUB_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file From 0eb50f49d407e5c1cfb76b795a51504a4b344417 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:31:47 +0200 Subject: [PATCH 17/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index da5585c..2ed8de3 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -21,13 +21,13 @@ jobs: - name: Build Go binary run: | go mod tidy - go build -o s3-client + go build -o s3-client - name: Get latest commit ID id: get_commit run: | commit_id=$(git rev-parse HEAD) - echo "commit_id=$commit_id" >> $GITHUB_ENV + echo "commit_id=$commit_id" >> $GITHUB_ENV - name: Get latest version and increment id: create_version @@ -35,6 +35,7 @@ jobs: latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') + # Sprawdzenie, czy nowy tag już istnieje if git rev-parse "$new_version" >/dev/null 2>&1; then echo "Tag $new_version already exists. Exiting." exit 1 @@ -43,7 +44,7 @@ jobs: echo "new_version=$new_version" >> $GITHUB_ENV git tag $new_version - git push origin $new_version + git push origin $new_version - name: Create Release id: create_release @@ -54,16 +55,13 @@ jobs: release_description: | Automatic release by Gitea CI Release version ${{ env.new_version }}. - Commit ID: ${{ env.commit_id }} + Commit ID: ${{ env.commit_id }} draft: false prerelease: false env: GITEA_TOKEN: ${{ secrets.TOKEN }} GITHUB_TOKEN: ${{ secrets.TOKEN }} - - name: Save release URL - run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV - - name: Upload Go binary to release uses: softprops/action-gh-release@v1 with: From b0b940c16a233c4c11d0e71db057d01921d10603 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:34:22 +0200 Subject: [PATCH 18/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 2ed8de3..ca19b24 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -35,7 +35,6 @@ jobs: latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') - # Sprawdzenie, czy nowy tag już istnieje if git rev-parse "$new_version" >/dev/null 2>&1; then echo "Tag $new_version already exists. Exiting." exit 1 @@ -46,6 +45,9 @@ jobs: git tag $new_version git push origin $new_version + - name: Verify Tag + run: git tag -l + - name: Create Release id: create_release uses: actions/create-release@v1 From 38d9c4a15ffd68f70904594a6f3f1431e41a9227 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:36:45 +0200 Subject: [PATCH 19/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index ca19b24..f9125cd 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -45,9 +45,6 @@ jobs: git tag $new_version git push origin $new_version - - name: Verify Tag - run: git tag -l - - name: Create Release id: create_release uses: actions/create-release@v1 @@ -68,5 +65,6 @@ jobs: uses: softprops/action-gh-release@v1 with: files: ./s3-client + tag_name: ${{ env.new_version }} env: GITHUB_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file From 4d4ecf8c112c89f867851defa85c5b8361ca210f Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:43:26 +0200 Subject: [PATCH 20/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index f9125cd..f80b060 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -18,10 +18,14 @@ jobs: with: go-version: '1.23.1' - - name: Build Go binary + - name: Build Go binary for Linux run: | go mod tidy - go build -o s3-client + go build -o s3-client_linux.x86_64 + + - name: Build Go binary for Windows + run: | + GOOS=windows GOARCH=amd64 go build -o s3-client_windows.x86_64.exe - name: Get latest commit ID id: get_commit @@ -61,10 +65,17 @@ jobs: GITEA_TOKEN: ${{ secrets.TOKEN }} GITHUB_TOKEN: ${{ secrets.TOKEN }} - - name: Upload Go binary to release + - name: Upload Go binaries to release uses: softprops/action-gh-release@v1 with: - files: ./s3-client + files: | + ./s3-client_linux.x86_64 + ./s3-client_windows.x86_64.exe tag_name: ${{ env.new_version }} + name: Release ${{ env.new_version }} + body: | + Automatic release by Gitea CI + Release version ${{ env.new_version }}. + Commit ID: ${{ env.commit_id }} env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.TOKEN }} From 40dda8edfc5a3ed49fc99ed638a4578219080108 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:46:37 +0200 Subject: [PATCH 21/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index f80b060..fad866b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -39,10 +39,9 @@ jobs: latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') - if git rev-parse "$new_version" >/dev/null 2>&1; then - echo "Tag $new_version already exists. Exiting." - exit 1 - fi + while git rev-parse "$new_version" >/dev/null 2>&1; do + new_version=$(echo $new_version | awk -F. '{$3+=1; printf "v%d.%d.%d", $1, $2, $3}') + done echo "new_version=$new_version" >> $GITHUB_ENV From b9836c393d30c62e7e950f3c9df240e93d86aaf1 Mon Sep 17 00:00:00 2001 From: leafus Date: Sun, 29 Sep 2024 04:50:34 +0200 Subject: [PATCH 22/22] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index fad866b..1107b0e 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -36,15 +36,23 @@ jobs: - name: Get latest version and increment id: create_version run: | - latest_version=$(git describe --tags --abbrev=0 || echo "v0.0.0") + git fetch --tags + + latest_version=$(git tag | sort -V | tail -n 1 || echo "v0.0.0") new_version=$(echo $latest_version | awk -F. '{printf "v%d.%d.%d", $1, $2, $3+1}') while git rev-parse "$new_version" >/dev/null 2>&1; do new_version=$(echo $new_version | awk -F. '{$3+=1; printf "v%d.%d.%d", $1, $2, $3}') done + echo "latest_version=$latest_version" >> $GITHUB_ENV echo "new_version=$new_version" >> $GITHUB_ENV + if git rev-parse "$new_version" >/dev/null 2>&1; then + echo "Tag $new_version already exists. Exiting." + exit 1 + fi + git tag $new_version git push origin $new_version