feat: added semantic release for gitea
All checks were successful
Release / Release (push) Successful in 10m19s
All checks were successful
Release / Release (push) Successful in 10m19s
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -32,5 +32,5 @@ jobs:
|
|||||||
run: pnpm install
|
run: pnpm install
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
run: pnpm semantic-release
|
run: pnpm semantic-release
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
["@semantic-release/git", {
|
["@semantic-release/git", {
|
||||||
"assets": ["package.json", "CHANGELOG.md"],
|
"assets": ["package.json", "CHANGELOG.md"],
|
||||||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
||||||
}],
|
}]
|
||||||
"@semantic-release/github"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
52
action.yml
52
action.yml
@@ -1,54 +1,52 @@
|
|||||||
name: 'Setup Weld CLI'
|
name: 'Setup Weld CLI'
|
||||||
description: 'Downloads a specific version of the weld CLI from a GitHub release, makes it executable, and adds it to the PATH.'
|
description: 'Downloads Weld CLI from Gitea releases and adds it to the PATH.'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
weld-version:
|
weld-version:
|
||||||
description: 'The version of weld to install (e.g., v0.2.0). Defaults to the latest release.'
|
description: 'Version to install (e.g., v0.2.0). Defaults to latest.'
|
||||||
required: false
|
required: false
|
||||||
default: 'latest'
|
default: 'latest'
|
||||||
repo:
|
repo:
|
||||||
description: 'The repository where the weld CLI is released, in owner/repo format.'
|
description: 'The owner/repo on Gitea.'
|
||||||
required: false
|
required: false
|
||||||
default: Xenox-Incorporated-Industries/weld
|
default: 'xenoxindustries/weld'
|
||||||
token:
|
token:
|
||||||
description: 'A GitHub token with read access to the weld repository releases.'
|
description: 'Gitea Personal Access Token (PAT).'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
branding:
|
|
||||||
icon: 'anchor'
|
|
||||||
color: 'blue'
|
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Get Version Tag for Download
|
- name: Get Release Metadata
|
||||||
id: get_version
|
id: get_version
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ inputs.token }}
|
|
||||||
run: |
|
run: |
|
||||||
VERSION_TAG=""
|
GITEA_URL="https://git.xenoxindustries.com"
|
||||||
|
|
||||||
if [[ "${{ inputs.weld-version }}" == "latest" ]]; then
|
if [[ "${{ inputs.weld-version }}" == "latest" ]]; then
|
||||||
echo "Figuring out the latest version..."
|
ENDPOINT="api/v1/repos/${{ inputs.repo }}/releases/latest"
|
||||||
# Get the tag name of the latest release from the specified repo
|
|
||||||
VERSION_TAG=$(gh release view --repo ${{ inputs.repo }} --json tagName --jq .tagName)
|
|
||||||
echo "Latest version is ${VERSION_TAG}"
|
|
||||||
else
|
else
|
||||||
VERSION_TAG="${{ inputs.weld-version }}"
|
ENDPOINT="api/v1/repos/${{ inputs.repo }}/releases/tags/${{ inputs.weld-version }}"
|
||||||
echo "Using specified version ${VERSION_TAG}"
|
|
||||||
fi
|
fi
|
||||||
echo "tag=${VERSION_TAG}" >> $GITHUB_OUTPUT
|
|
||||||
|
# Fetch release JSON from Gitea API
|
||||||
|
RESPONSE=$(curl -s -H "Authorization: token ${{ inputs.token }}" "$GITEA_URL/$ENDPOINT")
|
||||||
|
|
||||||
|
# Extract Tag and Download URL for the asset named 'weld'
|
||||||
|
TAG=$(echo $RESPONSE | jq -r '.tag_name')
|
||||||
|
# This jq filter finds the asset named 'weld' and gets its download URL
|
||||||
|
DL_URL=$(echo $RESPONSE | jq -r '.assets[] | select(.name=="weld") | .browser_download_url')
|
||||||
|
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
echo "url=$DL_URL" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Download Weld CLI
|
- name: Download Weld CLI
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ inputs.token }}
|
|
||||||
run: |
|
run: |
|
||||||
echo "Downloading weld version '${{ inputs.weld-version }}' from repo '${{ inputs.repo }}'..."
|
echo "Downloading Weld from ${{ steps.get_version.outputs.url }}..."
|
||||||
gh release download ${{ steps.get_version.outputs.tag }} \
|
curl -L -H "Authorization: token ${{ inputs.token }}" \
|
||||||
--repo ${{ inputs.repo }} \
|
-o ./weld \
|
||||||
--pattern 'weld' \
|
"${{ steps.get_version.outputs.url }}"
|
||||||
--output ./weld
|
|
||||||
echo "Download complete."
|
echo "Download complete."
|
||||||
|
|
||||||
- name: Make Weld CLI executable
|
- name: Make Weld CLI executable
|
||||||
|
|||||||
Reference in New Issue
Block a user