mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
chore(release): use release-core tag workflow
This commit is contained in:
20
.github/workflows/release-core.yml
vendored
20
.github/workflows/release-core.yml
vendored
@@ -4,12 +4,12 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: "Release tag, for example rel-v0.5.0"
|
description: "Core release tag, for example release-core/0.5.0"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "rel-v*"
|
- "release-core/*"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -29,18 +29,20 @@ jobs:
|
|||||||
TAG="${GITHUB_REF_NAME}"
|
TAG="${GITHUB_REF_NAME}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION="${TAG#rel-v}"
|
VERSION="${TAG#release-core/}"
|
||||||
|
VERSION="${VERSION#v}"
|
||||||
|
ENCODED_TAG="${TAG//\//%2F}"
|
||||||
ASSET_NAME="partner-core-${VERSION}.jar"
|
ASSET_NAME="partner-core-${VERSION}.jar"
|
||||||
ASSET_URL="https://github.com/slhaf/Partner/releases/download/${TAG}/${ASSET_NAME}"
|
ASSET_URL="https://github.com/slhaf/Partner/releases/download/${ENCODED_TAG}/${ASSET_NAME}"
|
||||||
|
|
||||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
echo "asset_name=${ASSET_NAME}" >> "$GITHUB_OUTPUT"
|
echo "asset_name=${ASSET_NAME}" >> "$GITHUB_OUTPUT"
|
||||||
echo "asset_url=${ASSET_URL}" >> "$GITHUB_OUTPUT"
|
echo "asset_url=${ASSET_URL}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
echo "Release tag: ${TAG}"
|
echo "Core release tag: ${TAG}"
|
||||||
echo "Release version: ${VERSION}"
|
echo "Core release version: ${VERSION}"
|
||||||
echo "Release asset: ${ASSET_NAME}"
|
echo "Core release asset: ${ASSET_NAME}"
|
||||||
|
|
||||||
- name: Checkout release source
|
- name: Checkout release source
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -84,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
gh release create "${{ steps.release.outputs.tag }}" \
|
gh release create "${{ steps.release.outputs.tag }}" \
|
||||||
"dist/${{ steps.release.outputs.asset_name }}" \
|
"dist/${{ steps.release.outputs.asset_name }}" \
|
||||||
--title "${{ steps.release.outputs.tag }}" \
|
--title "Partner Core ${{ steps.release.outputs.version }}" \
|
||||||
--notes "Partner Core ${{ steps.release.outputs.version }}"
|
--notes "Partner Core ${{ steps.release.outputs.version }}"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
@@ -132,4 +134,4 @@ jobs:
|
|||||||
|
|
||||||
git add registry/index.json
|
git add registry/index.json
|
||||||
git commit -m "chore(registry): update latest core release to ${{ steps.release.outputs.tag }}"
|
git commit -m "chore(registry): update latest core release to ${{ steps.release.outputs.tag }}"
|
||||||
git push origin HEAD:master
|
git push origin HEAD:master
|
||||||
|
|||||||
Reference in New Issue
Block a user