summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-03-22 15:13:07 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-03-22 19:05:00 +0800
commit2b93bdc12cb4ea00ea66a8e63f56c8876e8925a1 (patch)
treed70715174ba6e5fe46674f1579fafadd01038ac3
parent4844ec9d31a898821d7e4f93c87a1441566a7723 (diff)
ci: release
automatically ran after successful ci
-rw-r--r--.github/workflows/release-tip.yml76
1 files changed, 76 insertions, 0 deletions
diff --git a/.github/workflows/release-tip.yml b/.github/workflows/release-tip.yml
new file mode 100644
index 0000000..3c291fc
--- /dev/null
+++ b/.github/workflows/release-tip.yml
@@ -0,0 +1,76 @@
+name: Release Tip
+
+permissions:
+ contents: write
+ actions: read
+
+on:
+ workflow_run:
+ workflows: [continuous integration]
+ types: [completed]
+ branches: [main]
+
+ workflow_dispatch: {}
+
+concurrency:
+ group: ${{ github.workflow }}
+ cancel-in-progress: false
+
+jobs:
+ tag:
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Create Tip Tag
+ run: |
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+ git tag -fa tip -m "Latest Continuous Release" ${GITHUB_SHA}
+ git push --force origin tip
+
+ release:
+ needs: [tag]
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Download Build Artifacts
+ uses: actions/download-artifact@v4
+ with:
+ name: chat-server
+ path: artifacts/
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ run-id: ${{ github.event.workflow_run.id }}
+
+ - name: Create Source Archive
+ run: |
+ mkdir chat-server-source
+ cp -r src/ Makefile .clang-format README.md chat-server-source/ || true
+ tar -czv --owner=0 --group=0 --no-same-owner --no-same-permissions -f chat-server-source.tar.gz chat-server-source/
+ rm -rf chat-server-source
+
+ - name: Prepare Binary Archive
+ run: |
+ cd artifacts
+ chmod +x chat-server
+ tar -czv --owner=0 --group=0 --no-same-owner --no-same-permissions -f ../chat-server-linux-x86_64.tar.gz *
+ cd ..
+
+ - name: Release
+ uses: softprops/action-gh-release@v2
+ with:
+ name: 'Chat Server Tip (Latest)'
+ prerelease: true
+ tag_name: tip
+ target_commitish: ${{ github.sha }}
+ files: |
+ chat-server-source.tar.gz
+ chat-server-linux-x86_64.tar.gz
+ token: ${{ secrets.GITHUB_TOKEN }}
+