chore: update issue templates and workflow files for Gitea compatibility
Build Validation / build (push) Successful in 39s
Build Validation / build (push) Successful in 39s
This commit is contained in:
@@ -3,9 +3,6 @@ name: Release and Deploy Build
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
VERSION_MAJOR: '1'
|
||||
VERSION_MINOR: '1'
|
||||
@@ -16,17 +13,16 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
uses: https://gitea.com/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
- name: Use NodeJS v22.22.3
|
||||
uses: actions/setup-node@v6
|
||||
uses: https://gitea.com/actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22.22.3'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
@@ -39,7 +35,7 @@ jobs:
|
||||
id: release_version
|
||||
run: |
|
||||
package_version="$(node -p "require('./package.json').version")"
|
||||
echo "tag=${package_version}" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=${package_version}" >> "$GITEA_OUTPUT"
|
||||
|
||||
- name: Run Build
|
||||
run: npm run build
|
||||
@@ -49,24 +45,23 @@ jobs:
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Create GitHub release
|
||||
- name: Create Gitea Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||
GITEA_SHA: ${{ gitea.sha }}
|
||||
RELEASE_TAG: v${{ steps.release_version.outputs.tag }}
|
||||
run: |
|
||||
git fetch --force --tags
|
||||
|
||||
previous_tag="$(gh api repos/${{ github.repository }}/releases --paginate --jq '.[] | select(.draft == false) | .tag_name' | grep -Fxv "$RELEASE_TAG" | head -n 1 || true)"
|
||||
previous_tag="$(git describe --tags --abbrev=0 "$GITEA_SHA^" 2>/dev/null || true)"
|
||||
|
||||
if [ -n "$previous_tag" ]; then
|
||||
if git rev-parse --verify --quiet "${previous_tag}^{commit}" >/dev/null; then
|
||||
commit_messages="$(git log --reverse --format='- %s' "${previous_tag}..${GITHUB_SHA}")"
|
||||
else
|
||||
commit_messages="$(git log --reverse --format='- %s' "${GITHUB_SHA}")"
|
||||
fi
|
||||
full_changelog="https://github.com/${{ github.repository }}/compare/${previous_tag}...${RELEASE_TAG}"
|
||||
commit_messages="$(git log --reverse --format='- %s' "${previous_tag}..${GITEA_SHA}")"
|
||||
full_changelog="${GITEA_SERVER_URL}/${GITEA_REPOSITORY}/compare/${previous_tag}...${RELEASE_TAG}"
|
||||
else
|
||||
commit_messages="$(git log --reverse --format='- %s' "${GITHUB_SHA}")"
|
||||
commit_messages="$(git log --reverse --format='- %s' "${GITEA_SHA}")"
|
||||
full_changelog=""
|
||||
fi
|
||||
|
||||
@@ -84,8 +79,14 @@ jobs:
|
||||
fi
|
||||
} > release-notes.md
|
||||
|
||||
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
|
||||
gh release edit "$RELEASE_TAG" --title "$RELEASE_TAG" --notes-file release-notes.md
|
||||
node -e 'const fs = require("node:fs"); fs.writeFileSync("release.json", JSON.stringify({ tag_name: process.env.RELEASE_TAG, target_commitish: process.env.GITEA_SHA, name: process.env.RELEASE_TAG, body: fs.readFileSync("release-notes.md", "utf8") }))'
|
||||
|
||||
api_url="${GITEA_SERVER_URL}/api/v1/repos/${GITEA_REPOSITORY}/releases"
|
||||
auth_header="Authorization: token ${GITEA_TOKEN}"
|
||||
|
||||
if curl --fail --silent --header "$auth_header" --output current-release.json "${api_url}/tags/${RELEASE_TAG}"; then
|
||||
release_id="$(node -p 'require("./current-release.json").id')"
|
||||
curl --fail-with-body --header "$auth_header" --header 'Content-Type: application/json' --request PATCH --data-binary @release.json "${api_url}/${release_id}"
|
||||
else
|
||||
gh release create "$RELEASE_TAG" --target "${GITHUB_SHA}" --title "$RELEASE_TAG" --notes-file release-notes.md
|
||||
curl --fail-with-body --header "$auth_header" --header 'Content-Type: application/json' --request POST --data-binary @release.json "$api_url"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user