Rewrite workflows using native Gitea Actions shell commands instead of marketplace actions
Some checks failed
CI / test (push) Failing after 1s
Some checks failed
CI / test (push) Failing after 1s
This commit is contained in:
@@ -5,26 +5,47 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ github.repository }}
|
||||||
|
git clone https://gitea.com/${{ github.repository }} .
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
run: |
|
||||||
with:
|
apt-get update
|
||||||
python-version: '3.11'
|
apt-get install -y python3 python3-pip
|
||||||
|
python3 -m pip install --upgrade pip
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
pip install build
|
pip3 install build
|
||||||
python -m build
|
python3 -m build
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: actions/release-action@v1
|
run: |
|
||||||
with:
|
apt-get install -y curl jq
|
||||||
files: dist/*
|
TOKEN=${{ secrets.GITEA_TOKEN }}
|
||||||
draft: false
|
TAG_NAME=$(git describe --tags --abbrev=0 2>/dev/null || git rev-parse --short HEAD)
|
||||||
prerelease: false
|
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
response=$(curl -s -X POST "https://gitea.com/api/v1/repos/${{ github.repository }}/releases" \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"tag_name": "'$TAG_NAME'",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false,
|
||||||
|
"body": "Release '$TAG_NAME'"
|
||||||
|
}')
|
||||||
|
|
||||||
|
RELEASE_ID=$(echo $response | jq -r '.id')
|
||||||
|
|
||||||
|
for file in dist/*; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
curl -s -X POST "https://gitea.com/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets" \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
-F "file=@$file" \
|
||||||
|
-F "name=$(basename $file)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user