fix: ci problem. (#438)

* ci: test new jobs.

* ci: test new jobs.

* ci: fix shell problem.

* ci: fix shell problem.
This commit is contained in:
Estrella Pan
2023-08-29 13:53:21 +08:00
committed by GitHub
parent 2d3bcf64ad
commit e5871dff4c

View File

@@ -27,35 +27,41 @@ jobs:
version-info:
runs-on: ubuntu-latest
steps:
- name: Test
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.merged == false
- name: If release
id: release
run: |
echo "release=0" >> $GITHUB_OUTPUT
echo "dev=1" >> $GITHUB_OUTPUT
echo "version=Test" >> $GITHUB_OUTPUT
- name: Normal Release, generate tag.
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.merged == true
if [[${{ github.event_name }}== 'pull_request'] && [${{ github.event.pull_request.merged }} == true]] || \
[[ ${{ github.event_name }} == 'push' && (${{ github.ref }} == *'alpha'* || ${{ github.ref }} == *'beta'*) ]]; then
echo "release=1" >> $GITHUB_OUTPUT
else
echo "release=0" >> $GITHUB_OUTPUT
fi
- name: If dev
id: dev
run: |
git config --local user.email
git config --local user.name "github-actions"
git tag -a ${{ github.event.pull_request.title }} -m ${{ github.event.pull_request.body }}
git push origin ${{ github.event.pull_request.title }}
echo "release=1" >> $GITHUB_OUTPUT
echo "dev=0" >> $GITHUB_OUTPUT
echo "version=${{ github.event.pull_request.title }}" >> $GITHUB_OUTPUT
- name: Dev Release
if: |
github.event_name == 'push' &&
contains(github.ref, 'alpha') ||
contains(github.ref, 'beta')
if [ ${{ github.ref }} == *'alpha'* || ${{ github.ref }} == *'beta'* ]; then
echo "dev=1" >> $GITHUB_OUTPUT
else
echo "dev=0" >> $GITHUB_OUTPUT
fi
- name: Check version
id: version
run: |
echo "release=1" >> $GITHUB_OUTPUT
echo "dev=1" >> $GITHUB_OUTPUT
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
if [${{ github.event_name }} == 'pull_request' && ${{ github.event.pull_request.merged }} == true]; then
echo "version=${{ github.event.pull_request.title }}" >> $GITHUB_OUTPUT
git config --local user.email
git config --local user.name "github-actions"
git tag -a ${{ github.event.pull_request.title }} -m ${{ github.event.pull_request.body }}
git push origin ${{ github.event.pull_request.title }}
elif [[ ${{ github.event_name }} == 'push' && (${{ github.ref }} == *'alpha'* || ${{ github.ref }} == *'beta'*) ]]; then
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
echo "version=Test" >> $GITHUB_OUTPUT
fi
outputs:
release: ${{ steps.release.outputs.release }}
dev: ${{ steps.dev.outputs.dev }}
version: ${{ steps.version.outputs.version }}
build-webui:
runs-on: ubuntu-latest