Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIGOV-dale #576

Merged
merged 59 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
17aa5c0
APIGOV-dale - test release
dfeldick Sep 27, 2022
492357d
APIGOV-dale - test
dfeldick Sep 27, 2022
784a53c
test
dfeldick Sep 27, 2022
02b274a
APIGOV-dale - test
dfeldick Sep 27, 2022
deb31b2
APIGOV-dale - test
dfeldick Sep 27, 2022
91573f9
APIGOV-dale - test
dfeldick Sep 27, 2022
1212e16
APIGOV-dale - test
dfeldick Sep 27, 2022
4a67dee
APIGOV-dale - test
dfeldick Sep 27, 2022
51a8253
APIGOV-dale - test
dfeldick Sep 27, 2022
7c5e894
APIGOV-dale - test
dfeldick Sep 27, 2022
9e1a1a5
APIGOV-dale - test
dfeldick Sep 27, 2022
126b31e
APIGOV-dale - test
dfeldick Sep 27, 2022
d3f1989
APIGOV-dale - test
dfeldick Sep 27, 2022
ae01e22
APIGOV-dale - test
dfeldick Sep 27, 2022
94aefc5
APIGOV-dale - t
dfeldick Sep 27, 2022
fca71b6
APIGOV-dale - t
dfeldick Sep 27, 2022
533b9a6
APIGOV-dale - t
dfeldick Sep 27, 2022
6d2b1a7
APIGOV-dale - t
dfeldick Sep 27, 2022
f2ad543
APIGOV-dale - t
dfeldick Sep 27, 2022
f5dbc9b
APIGOV-dale - t
dfeldick Sep 27, 2022
52b3002
APIGOV-dale - t
dfeldick Sep 27, 2022
c565c86
APIGOV-dale - t
dfeldick Sep 27, 2022
e9fbb78
APIGOV-dale - t
dfeldick Sep 27, 2022
51dc9da
APIGOV-dale - t
dfeldick Sep 27, 2022
a4b6dc2
APIGOV-dale - s
dfeldick Sep 27, 2022
b2fcd34
t
dfeldick Sep 27, 2022
85ff4ba
APIGOV-dale - s
dfeldick Sep 27, 2022
d396593
APIGOV-dale - s
dfeldick Sep 27, 2022
436ca37
Merge branch 'main' into APIGOV-dale
dfeldick Oct 6, 2022
63fab08
Merge branch 'main' into APIGOV-dale
dfeldick Oct 17, 2022
5face78
APIGOV-dale - test
dfeldick Oct 17, 2022
0e6c6d6
APIGOV-dale - test
dfeldick Oct 17, 2022
a58407e
APIGOV-dale - test
dfeldick Oct 17, 2022
da70d5d
APIGOV-dale - tets
dfeldick Oct 17, 2022
15eadbf
APIGOV-dale - test
dfeldick Oct 18, 2022
c42819b
APIGOV-dale - test
dfeldick Oct 18, 2022
b90ba06
APIGOV-dale -
dfeldick Oct 18, 2022
3f94565
APIGOV-dale - test
dfeldick Oct 18, 2022
c974bed
APIGOV-dale - trdt
dfeldick Oct 18, 2022
506581c
APIGOV-dale - test
dfeldick Oct 18, 2022
a7ea696
APIGOV-dale - full test
dfeldick Oct 18, 2022
38fbbc7
APIGOV-dale - full test
dfeldick Oct 18, 2022
64e79d9
APIGOV-dale - full est
dfeldick Oct 18, 2022
1b4f3ae
APIGOV-dale - test
dfeldick Oct 18, 2022
942e88f
APIGOV-dale - test
dfeldick Oct 18, 2022
f5a260e
APIGOV-dale - test
dfeldick Oct 18, 2022
e5db41e
APIGOV-dale - test
dfeldick Oct 18, 2022
8c5b1e2
APIGOV-dale - test
dfeldick Oct 18, 2022
3f2c3ab
APIGOV-dale - tets
dfeldick Oct 18, 2022
f993f63
APIGOV-dale - sss
dfeldick Oct 18, 2022
4678e02
APIGOV-dale - test
dfeldick Oct 18, 2022
7b52e46
APIGOV-dale - test
dfeldick Oct 18, 2022
db93573
APIGOV-dale - test
dfeldick Oct 18, 2022
4884c43
APIGOV-dale - a
dfeldick Oct 18, 2022
00abbee
APIGOV-dale - test
dfeldick Oct 18, 2022
6d09c9d
APIGOV-dale - a
dfeldick Oct 18, 2022
d6c5bd5
APIGOV-dale - b
dfeldick Oct 18, 2022
d0c9f6b
APIGOV-dale - c
dfeldick Oct 18, 2022
c9b23f1
APIGOV-dale - final cleanup
dfeldick Oct 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,33 @@ jobs:
working-directory: .
steps:
- name: Checkout main
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: main
- name: Set version variables
id: vars
run: |
# The full GITHUB_REF should look like: refs/tags/vn.n.n
echo "GITHUB_REF: ${GITHUB_REF}"

# this mess parses GITHUB_REF into its major/minor/patch parts
MAJOR_VER=$(echo ${GITHUB_REF#*v} | cut -d. -f1)
MINOR_VER=$(echo ${GITHUB_REF#*v} | cut -d. -f2)
PATCH_VER=$(echo ${GITHUB_REF#*v} | cut -d. -f3)
declare -i PATCH_VER
PATCH_VER+=1
echo ::set-output name=next_ver::${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}
- name: Update version file
working-directory: ./build/scripts
# This passes vn.n.n to the shellscript. The full GITHUB_REF is refs/tags/vn.n.n
# This passes vn.n.n to the shellscript.
run: |
./promote.sh ${GITHUB_REF}
./promote.sh ${{ steps.vars.outputs.next_ver }}
- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
branch: APIGOV-updateversion
commit-message: INT - update to new release ${GITHUB_REF_NAME}
title: INT - update to new release ${GITHUB_REF_NAME}
commit-message: INT - update to new release ${{ steps.vars.outputs.next_ver }}
title: INT - update to new release ${{ steps.vars.outputs.next_ver }}
base: main
delete-branch: true

Expand Down
46 changes: 3 additions & 43 deletions build/scripts/promote.sh
Original file line number Diff line number Diff line change
@@ -1,64 +1,28 @@
#!/bin/bash
check_required_param() {
echo $1
if [ -z $1 ]; then
return 1
fi

pat='v[0-9]+\.[0-9]+\.[0-9]+'
# version must be of the form: x.y.z
pat='[0-9]+\.[0-9]+\.[0-9]+'
if [[ $1 =~ $pat ]]; then
return 0
fi
return 1
}

set_version_variables() {
# remove refs/tags/v
incoming_version=$1
version="${incoming_version:11}"

let MAJOR_VERSION=$(echo $version | cut -d. -f1)
let MINOR_VERSION=$(echo $version | cut -d. -f2)
let PATCH_VERSION=$(echo $version | cut -d. -f3)
let NEW_PATCH_VERSION=($PATCH_VERSION+1)

# right now, this only does patch versioning.
export NEW_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${NEW_PATCH_VERSION}"
export NEW_VERSION=$1
export BASE_DIR=$(realpath $(dirname $0)/../..)
export MSG="update to new release ${NEW_VERSION}"
}

checkout_main() {
# need these in order to commit
git config --global user.name "Gitlab action"
git config --global user.email "[email protected]"
# git fetch
# git checkout main
}

update_version_file() {
echo "Updating version file to version ${NEW_VERSION}"
echo ${NEW_VERSION} > ${BASE_DIR}/version
}

commit_promotion() {
# put this back when we can figure out how to push directly to github sdk, which is protected
# maybe define a user that can push and go git config --locak(global) user
# maybe this? https://github.com/marketplace/actions/add-commit or this https://github.com/peter-evans/create-pull-request
# echo "Committing the new promoted version to main"
# cd ${BASE_DIR}
# git add version
# git commit -m "INT - ${MSG}"
# git push --force origin main

echo "Until the script can be fixed, you must manually do the next steps"
echo " 1) create a new SDK branch"
echo " 2) update the version file by adding 1 to the last digit"
echo " 3) commit the branch with the following message: 'INT - ${MSG}'"
echo " 4) create a pull request on github and await approval"
echo " 5) merge the branch into main"
}

main() {
check_required_param $1
if [ $? -eq 1 ]; then
Expand All @@ -67,13 +31,9 @@ main() {
exit
fi

# checkout_main

set_version_variables $1

update_version_file

commit_promotion
}

main $@