fix tags.
Some checks failed
Build Applications / PullDocker (push) Successful in 4s
Build Applications / Build (push) Successful in 2m16s
Deploy Release / Build (push) Has been cancelled
Windows CI / build (push) Has been cancelled
Release tag / build (push) Successful in 3m53s

This commit is contained in:
amass 2024-11-06 00:02:58 +08:00
parent 14dd4c8ee6
commit 2a69cdc84b
2 changed files with 23 additions and 3 deletions

View File

@ -7,7 +7,14 @@ jobs:
steps:
- name: Clone repository
run: |
$branch = "${{ github.ref }}" -replace '^refs/heads/', ''
$ref = "${{ github.ref }}"
if ($ref -like 'refs/heads/*') {
$branch = $ref -replace '^refs/heads/', ''
} elseif ($ref -like 'refs/tags/*') {
$branch = $ref -replace '^refs/tags/', ''
} else {
$branch = $ref
}
git clone --depth 1 --branch=$branch https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_PASSWORD }}@amass.fun/gitea/${{ gitea.repository }}.git .
git checkout ${{ github.sha }}
- name: Build and deploy
@ -15,3 +22,9 @@ jobs:
resources/build.ps1 build
resources/build.ps1 deploy
resources/build.ps1 changelog
- name: Upload Gitea Release
uses: akkuman/gitea-release-action@v1
with:
body_path: build/CHANGELOG.txt
files: |-
build/SmartLockerTools_v*.zip

View File

@ -10,7 +10,14 @@ jobs:
steps:
- name: Clone repository
run: |
$branch = "${{ github.ref }}" -replace '^refs/tags/', ''
$ref = "${{ github.ref }}"
if ($ref -like 'refs/heads/*') {
$branch = $ref -replace '^refs/heads/', ''
} elseif ($ref -like 'refs/tags/*') {
$branch = $ref -replace '^refs/tags/', ''
} else {
$branch = $ref
}
git clone --depth 1 --branch=$branch https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_PASSWORD }}@amass.fun/gitea/${{ gitea.repository }}.git .
git checkout ${{ github.sha }}
- name: Build and deploy