Use Gitea API for releases instead of GitHub action
This commit is contained in:
+23
-10
@@ -45,15 +45,28 @@ jobs:
|
||||
path: ./dist
|
||||
- name: Create Git Tag
|
||||
run: |
|
||||
git tag ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
||||
git push origin ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
||||
- name: Create Release and Upload Assets
|
||||
uses: https://github.com/softprops/action-gh-release@v1
|
||||
with:
|
||||
files: ./dist/*.pkg.tar.zst
|
||||
tag_name: ${{ needs.build_arch.steps.pkg_version.outputs.version }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
VERSION=$(ls dist/*.pkg.tar.zst | sed 's/^rscli-git-\(r[^ ]*\)-.*$/\1/')
|
||||
git tag "$VERSION"
|
||||
git push origin "$VERSION"
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
- name: Create Gitea Release
|
||||
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