From 3b3723a07f44b336e65eba455369f63b32b136d7 Mon Sep 17 00:00:00 2001 From: Max Base Date: Wed, 11 Sep 2024 15:50:59 +0330 Subject: [PATCH] Update build-release.yml --- .github/workflows/build-release.yml | 57 +++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index beb1de27..6842fff1 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -84,21 +84,19 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - - name: Create tag - id: create_tag + + - name: Read version from VERSION file + id: get_version run: | - tag_name="v1.0.${{ github.run_number }}" - - git tag $tag_name - git push origin $tag_name - + VERSION=$(cat VERSION) + echo "VERSION=${VERSION}" >> $GITHUB_ENV + - name: Download Linux artifact uses: actions/download-artifact@v4 with: name: salam-linux path: ./release - + - name: Rename Linux binary to avoid conflict run: | mv ./release/salam ./release/salam-linux @@ -118,13 +116,48 @@ jobs: with: name: salam-windows path: ./release - + + - name: Post Linux release file to SERVER_VERSIONS_API + run: | + curl -X POST "${{ secrets.SERVER_VERSIONS_API }}" \ + -F "file=@./release/salam-linux" \ + -F "version=${{ env.VERSION }}" \ + -F "date=$(date +'%Y-%m-%d')" \ + -F "time=$(date +'%H:%M:%S')" \ + -F "platform=linux" + + - name: Post macOS release file to SERVER_VERSIONS_API + run: | + curl -X POST "${{ secrets.SERVER_VERSIONS_API }}" \ + -F "file=@./release/salam-mac" \ + -F "version=${{ env.VERSION }}" \ + -F "date=$(date +'%Y-%m-%d')" \ + -F "time=$(date +'%H:%M:%S')" \ + -F "platform=macos" + + - name: Post Windows release file to SERVER_VERSIONS_API + run: | + curl -X POST "${{ secrets.SERVER_VERSIONS_API }}" \ + -F "file=@./release/salam-windows" \ + -F "version=${{ env.VERSION }}" \ + -F "date=$(date +'%Y-%m-%d')" \ + -F "time=$(date +'%H:%M:%S')" \ + -F "platform=windows" + + - name: Create tag + id: create_tag + run: | + tag_name="v1.0.${{ github.run_number }}" + git tag $tag_name + git push origin $tag_name + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.create_tag.outputs.tag_name }} files: | - release/salam - release/salam.exe + release/salam-linux + release/salam-mac + release/salam-windows env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}