mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-22 22:18:23 -05:00
ci: add release.yml to help automate release versions - Fixing the release portion to prepend a v
This commit is contained in:
parent
a945c00340
commit
6b75b41083
33
.github/workflows/release.yml
vendored
33
.github/workflows/release.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
|||||||
Release_tag="v0.1.0"
|
Release_tag="v0.1.0"
|
||||||
elif [ -z "$latest_release" ]; then
|
elif [ -z "$latest_release" ]; then
|
||||||
echo "No releases found. Using latest tag version."
|
echo "No releases found. Using latest tag version."
|
||||||
Release_tag=$latest_release
|
Release_tag=$latest_tag
|
||||||
elif [ -z "$latest_tag" ]; then
|
elif [ -z "$latest_tag" ]; then
|
||||||
echo "No tags found. Using latest release version."
|
echo "No tags found. Using latest release version."
|
||||||
Release_tag=$latest_release
|
Release_tag=$latest_release
|
||||||
@ -85,17 +85,30 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
create_release() {
|
create_release() {
|
||||||
curl \
|
local version="${1}"
|
||||||
-X POST \
|
if [ -n "${version}" ]; then
|
||||||
-H "Accept: application/vnd.github+json" \
|
version="V${version}"
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
fi
|
||||||
https://api.github.com/repos/${repo}/releases \
|
curl \
|
||||||
-d '{"tag_name":"'"${1}"'","target_commitish":"'"${branch}"'","name":"'"${1}"'","body":"","draft":false,"prerelease":false,"generate_release_notes":true}'
|
-X POST \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
|
https://api.github.com/repos/${repo}/releases \
|
||||||
|
-d '{"tag_name":"'"${version}"'","target_commitish":"'"${branch}"'","name":"'"${version}"'","body":"","draft":false,"prerelease":false,"generate_release_notes":true}'
|
||||||
}
|
}
|
||||||
|
|
||||||
repo=${{ github.repository }}
|
repo=${{ github.repository }}
|
||||||
branch=${{ github.head_ref }}
|
branch=${{ github.head_ref }}
|
||||||
|
|
||||||
create_release "${{ steps.bump_version_major.outputs.next-version }}"
|
# Check if steps are defined before calling create_release so we don't do unnecessary steps
|
||||||
create_release "${{ steps.bump_version_minor.outputs.next-version }}"
|
if [ -n "${{ steps.bump_version_major.outputs.next-version }}" ]; then
|
||||||
create_release "${{ steps.bump_version_patch.outputs.next-version }}"
|
create_release "${{ steps.bump_version_major.outputs.next-version }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${{ steps.bump_version_minor.outputs.next-version }}" ]; then
|
||||||
|
create_release "${{ steps.bump_version_minor.outputs.next-version }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${{ steps.bump_version_patch.outputs.next-version }}" ]; then
|
||||||
|
create_release "${{ steps.bump_version_patch.outputs.next-version }}"
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user