Skip to content

Commit

Permalink
Update build-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax authored Sep 11, 2024
1 parent 32ccd15 commit 3b3723a
Showing 1 changed file with 45 additions and 12 deletions.
57 changes: 45 additions & 12 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

0 comments on commit 3b3723a

Please sign in to comment.