update ci

This commit is contained in:
22
2025-06-04 21:43:37 +08:00
parent e982e2bb4d
commit 40e7162d5d

View File

@@ -1,4 +1,4 @@
name: CI
name: ci
on:
push:
branches:
@@ -16,7 +16,6 @@ on:
jobs:
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- name: Clone repository
@@ -51,7 +50,6 @@ jobs:
path: build\windows\x64\runner\Release\IRIS-windows-installer.exe
build-android:
name: Build Android
runs-on: ubuntu-latest
steps:
- name: Clone repository
@@ -101,10 +99,11 @@ jobs:
path: IRIS-android-x86_64.apk
release:
name: Release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [build-windows, build-android]
needs:
- build-windows
- build-android
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -115,26 +114,34 @@ jobs:
cmd: yq '.version' 'pubspec.yaml'
- name: Print version
run: echo ${{ steps.yq.outputs.result }}
- name: Create Tag
id: create_tag
- name: Prepare tag name
id: tag_name
run: |
VERSION="${{ steps.yq.outputs.result }}"
TAG_NAME="v${VERSION%%+*}"
TAG_NAME="v${VERSION}"
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_OUTPUT"
- name: Check tag
uses: mukunku/tag-exists-action@v1.6.0
id: check-tag
with:
tag: ${{ steps.tag_name.outputs.TAG_NAME }}
- name: Eextract log
run: python extract_log.py ${{ steps.create_tag.outputs.TAG_NAME }}
if: steps.check-tag.outputs.exists == 'false'
run: python extract_log.py ${{ steps.tag_name.outputs.TAG_NAME }}
- name: Download artifact
if: steps.check-tag.outputs.exists == 'false'
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Release
if: steps.check-tag.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.TAG_NAME }}
body_path: CHANGELOG_${{ steps.create_tag.outputs.TAG_NAME }}.md
tag_name: ${{ steps.tag_name.outputs.TAG_NAME }}
body_path: CHANGELOG_${{ steps.tag_name.outputs.TAG_NAME }}.md
draft: false
prerelease: false
files: |