This commit is contained in:
parent
cb1175a5d1
commit
6ad3ac8743
1 changed files with 21 additions and 7 deletions
|
|
@ -30,14 +30,28 @@ jobs:
|
|||
run: |
|
||||
cp dist/TinyWeb TinyWeb-linux-x64
|
||||
chmod +x TinyWeb-linux-x64
|
||||
ls -la TinyWeb-linux-x64
|
||||
|
||||
- name: Create Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: https://code.forgejo.org/actions/forgejo-release@v2
|
||||
with:
|
||||
direction: upload
|
||||
release-dir: .
|
||||
override: true
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
||||
run: |
|
||||
TAG="${{ github.ref_name }}"
|
||||
REPO="${{ github.repository }}"
|
||||
TOKEN="${{ secrets.FORGEJO_TOKEN }}"
|
||||
# Try to create release (ignore error if exists)
|
||||
curl -X POST "https://git.derickphan.com/api/v1/repos/$REPO/releases" \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}" || true
|
||||
|
||||
- name: Upload to Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
FILE=TinyWeb-linux-x64
|
||||
TAG="${{ github.ref_name }}"
|
||||
REPO="${{ github.repository }}"
|
||||
TOKEN="${{ secrets.FORGEJO_TOKEN }}"
|
||||
curl -X POST "https://git.derickphan.com/api/v1/repos/$REPO/releases/$TAG/assets" \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-F "attachment=@$FILE"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue