Skip to content

Commit

Permalink
ci: add release
Browse files Browse the repository at this point in the history
  • Loading branch information
nini22P committed Jan 9, 2025
1 parent 884f3fe commit 952f923
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,60 @@ jobs:
with:
name: Iris_android
path: Iris_android.apk

release:
name: Release
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: [build-windows, build-android]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version
id: yq
uses: mikefarah/yq@master
with:
cmd: yq -r '.version | sub("\\+.*"; "")' 'pubspec.yaml'
- name: Print version
run: echo ${{ steps.yq.outputs.result }}
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: Iris_windows
path: artifacts
- name: Download Android artifact
uses: actions/download-artifact@v4
with:
name: Iris_android
path: artifacts
- name: Create or Replace Tag
id: create_tag
run: |
TAG_NAME="v${{ steps.yq.outputs.result }}"
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_OUTPUT"
# Check if the tag exists
if git show-ref --quiet "refs/tags/$TAG_NAME"; then
echo "Tag $TAG_NAME already exists, deleting..."
if git tag -d "$TAG_NAME" && git push origin --delete "$TAG_NAME"; then
echo "Tag $TAG_NAME deleted."
else
echo "Failed to delete tag $TAG_NAME."
exit 1
fi
fi
echo "Creating new tag $TAG_NAME..."
git tag "$TAG_NAME"
git push origin "$TAG_NAME"
- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.TAG_NAME }}
name: Iris ${{ steps.create_tag.outputs.TAG_NAME }}
body_path: CHANGELOG.md
draft: true
prerelease: false
files: |
artifacts/Iris_windows.zip
artifacts/Iris_android.apk
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Changelog
* WebDAV and local storage support

### 更新日志
* 支持 WebDAV 和本地存储

0 comments on commit 952f923

Please sign in to comment.