Use Gitea API for releases instead of GitHub action
This commit is contained in:
+23
-10
@@ -45,15 +45,28 @@ jobs:
|
|||||||
path: ./dist
|
path: ./dist
|
||||||
- name: Create Git Tag
|
- name: Create Git Tag
|
||||||
run: |
|
run: |
|
||||||
git tag ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
VERSION=$(ls dist/*.pkg.tar.zst | sed 's/^rscli-git-\(r[^ ]*\)-.*$/\1/')
|
||||||
git push origin ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
git tag "$VERSION"
|
||||||
- name: Create Release and Upload Assets
|
git push origin "$VERSION"
|
||||||
uses: https://github.com/softprops/action-gh-release@v1
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
with:
|
- name: Create Gitea Release
|
||||||
files: ./dist/*.pkg.tar.zst
|
|
||||||
tag_name: ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
TAG: ${{ env.VERSION }}
|
||||||
|
run: |
|
||||||
|
PACKAGE_FILE=$(ls dist/*.pkg.tar.zst)
|
||||||
|
FILE_NAME=$(basename "$PACKAGE_FILE")
|
||||||
|
RELEASE_JSON=$(curl -s -X POST "https://git.elordenador.org/api/v1/repos/RedSocial/cli/releases" \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"$TAG\",
|
||||||
|
\"name\": \"Release $TAG\",
|
||||||
|
\"draft\": false,
|
||||||
|
\"prerelease\": false
|
||||||
|
}")
|
||||||
|
RELEASE_ID=$(echo "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
|
||||||
|
curl -X POST "https://git.elordenador.org/api/v1/repos/RedSocial/cli/releases/$RELEASE_ID/assets?name=$FILE_NAME" \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
--data-binary "@$PACKAGE_FILE"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user