summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml67
-rw-r--r--act/prerelease.json3
-rw-r--r--act/release.json3
-rwxr-xr-xact/run-act.sh1
4 files changed, 62 insertions, 12 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 823502c7..59203a09 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -15,6 +15,15 @@ on:
- none
- prerelease
- release
+ bump:
+ type: choice
+ description: Semver to bump
+ default: 'none'
+ options:
+ - none
+ - patch
+ - minor
+ - major
permissions:
contents: write
@@ -25,6 +34,11 @@ jobs:
runs-on: ubuntu-latest
steps:
+ - name: Print input
+ run : |
+ echo "release: ${{ github.event.inputs.release }}\n"
+ echo "bump: ${{ github.event.inputs.bump }}\n"
+
- name: Checkout 🧰
uses: actions/checkout@v3
@@ -106,11 +120,26 @@ jobs:
if [[ "$VERSION" =~ "-pre" ]]; then
printf "is prerelease, bumping to release\n"
OUT=$(semver bump release "$VERSION")
- printf "OUT: ${OUT}\n"
+ printf "OUT: ${OUT}\n"\
+ printf "bumping by selected type.\n"
+ if [[ "${{github.event.inputs.bump}}" != "none" ]]; then
+ OUT=$(semver bump ${{github.event.inputs.bump}} "$OUT")
+ printf "OUT: ${OUT}\n"
+ else
+ printf "no type selected, defaulting to patch.\n"
+ OUT=$(semver bump patch "$OUT")
+ printf "OUT: ${OUT}\n"
+ fi
elif [[ ! "$VERSION" =~ "-pre" ]]; then
- printf "previous tag is a release, bumping by a patch\n"
- OUT=$(semver bump patch "$VERSION")
- printf "OUT: ${OUT}\n"
+ printf "previous tag is a release, bumping by selected type.\n"
+ if [[ "${{github.event.inputs.bump}}" != "none" ]]; then
+ OUT=$(semver bump ${{github.event.inputs.bump}} "$VERSION")
+ printf "OUT: ${OUT}\n"
+ else
+ printf "previous tag is a release, but no bump selected. Defaulting to a patch bump.\n"
+ OUT=$(semver bump patch "$VERSION")
+ printf "OUT: ${OUT}\n"
+ fi
fi
echo "vOUT: v$OUT"
echo ::set-output name=tag_name::v$OUT
@@ -138,7 +167,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
- steps:
+ steps:
- name: Checkout 🧰
uses: actions/checkout@v3
@@ -170,16 +199,34 @@ jobs:
echo "VERS: $VERSION"
OUT=""
if [[ ! "$VERSION" =~ "-pre" ]]; then
- printf "is release, bumping minor version and prerel\n"
- OUT=$(semver bump patch "$VERSION")
+ printf "pre-release from release, bumping by selected type and prerel\n"
+ if [[ ! ${{ github.event.inputs.bump }} == "none" ]]; then
+ OUT=$(semver bump ${{github.event.inputs.bump}} "$VERSION")
+ printf "OUT: ${OUT}\n"
+ else
+ printf "type not selected, defaulting to patch\n"
+ OUT=$(semver bump patch "$VERSION")
+ printf "OUT: ${OUT}\n"
+ fi
OUT="$OUT-pre"
OUT=$(semver bump prerel "$OUT")
printf "OUT: ${OUT}\n"
elif [[ "$VERSION" =~ "-pre" ]]; then
- printf "is a prerelease, bumping prerel\n"
- OUT=$(semver bump prerel "$VERSION")
- printf "OUT: ${OUT}\n"
+ printf "pre-release to pre-release, bumping by selected type and or prerel version\n"
+ if [[ ! ${{ github.event.inputs.bump }} == "none" ]]; then
+ OUT=$(semver bump ${{github.event.inputs.bump}} "$VERSION")
+ printf "OUT: ${OUT}\n"
+ printf "bumping prerel\n"
+ OUT=$(semver bump prerel "$OUT")
+ printf "OUT: ${OUT}\n"
+ else
+ printf "type not selected, defaulting to new pre-release only\n"
+ printf "bumping prerel\n"
+ OUT=$(semver bump prerel "$VERSION")
+ printf "OUT: ${OUT}\n"
+ fi
fi
+ printf "vOUT: v${OUT}\n"
echo ::set-output name=tag_name::v$OUT
- name: Push tag 📤
diff --git a/act/prerelease.json b/act/prerelease.json
index 4ef0e8c7..6e9f4f81 100644
--- a/act/prerelease.json
+++ b/act/prerelease.json
@@ -1,5 +1,6 @@
{
"inputs": {
- "release": "prerelease"
+ "release": "prerelease",
+ "bump": "none"
}
} \ No newline at end of file
diff --git a/act/release.json b/act/release.json
index fe400521..2f39ae7f 100644
--- a/act/release.json
+++ b/act/release.json
@@ -1,5 +1,6 @@
{
"inputs": {
- "release": "release"
+ "release": "release",
+ "bump": "none"
}
} \ No newline at end of file
diff --git a/act/run-act.sh b/act/run-act.sh
index 71a3d40c..63b325a4 100755
--- a/act/run-act.sh
+++ b/act/run-act.sh
@@ -1,6 +1,7 @@
#!/bin/bash
type=$1
+# bump=$2
oldartifactsdir="old"