feat: add ability to create pre-releases
This commit is contained in:
@@ -63,3 +63,41 @@ jobs:
|
||||
fi
|
||||
|
||||
echo "New tag: ${{ steps.increment-tag.outputs.new-tag }}"
|
||||
|
||||
prerelease-test:
|
||||
name: Prerelease Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- run: npm ci
|
||||
- name: Test prerelease tag generation
|
||||
id: prerelease-tag
|
||||
uses: ./
|
||||
with:
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
prerelease: "true"
|
||||
- name: Verify prerelease tag format
|
||||
run: |
|
||||
new_tag="${{ steps.prerelease-tag.outputs.new-tag }}"
|
||||
echo "Generated prerelease tag: $new_tag"
|
||||
|
||||
# Check if tag contains -rc- prefix
|
||||
if [[ "$new_tag" == *"-rc-"* ]]; then
|
||||
echo "✓ Prerelease tag format is correct"
|
||||
else
|
||||
echo "✗ Prerelease tag format is incorrect. Expected format: X.Y.Z-rc-<sha>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if tag ends with a hash-like string (at least 7 characters)
|
||||
if [[ "$new_tag" =~ -rc-[a-f0-9]{7,}$ ]]; then
|
||||
echo "✓ Prerelease tag contains valid SHA suffix"
|
||||
else
|
||||
echo "✗ Prerelease tag SHA suffix is invalid"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user