File tree Expand file tree Collapse file tree 6 files changed +112
-1
lines changed Expand file tree Collapse file tree 6 files changed +112
-1
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ file=" ./CHANGELOG.md"
4
+ regex=' ^## \[([0-9]+)\.([0-9]+)\.([0-9]+)\] - ([0-9]{4}-[0-9]{2}-[0-9]{2})$'
5
+
6
+ version=' '
7
+ log=()
8
+
9
+ while read line; do
10
+ if [[ $line =~ $regex ]]; then
11
+ if [[ -z " $version " ]]; then
12
+ major=" ${BASH_REMATCH[1]} "
13
+ minor=" ${BASH_REMATCH[2]} "
14
+ patch=" ${BASH_REMATCH[3]} "
15
+ version=" $major .$minor .$patch "
16
+ date=" ${BASH_REMATCH[4]} "
17
+ else
18
+ break
19
+ fi
20
+ elif [[ ! -z " $version " ]]; then
21
+ log+=(" $line " )
22
+ fi
23
+ done <<< " $(cat " $file " )"
Original file line number Diff line number Diff line change
1
+ name : Pre Release
2
+ on :
3
+ pull_request :
4
+ paths : [CHANGELOG.md]
5
+ branches : [master]
6
+ jobs :
7
+ Post-Comment :
8
+ name : Post Comment
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - uses : actions/checkout@v2
12
+ - run : |
13
+ source .github/scripts/changelog.sh
14
+ git fetch origin --tags
15
+ if [[ ! -z "$version" && -z "$(git tag -l "v$version")" ]]; then
16
+ echo "BODY<<EOF" >> $GITHUB_ENV
17
+ echo "$(IFS=$'\n'; echo "${log[*]}")" >> $GITHUB_ENV
18
+ echo "EOF" >> $GITHUB_ENV
19
+ echo "TAG=v$version" >> $GITHUB_ENV
20
+ fi
21
+ shell: bash
22
+ - if : ${{ env.TAG != '' }}
23
+ uses : marocchino/sticky-pull-request-comment@82e7a0d3c51217201b3fedc4ddde6632e969a477 # v2.1.1
24
+ with :
25
+ header : pre-release
26
+ recreate : true
27
+ message : |
28
+ ## ${{ env.TAG }}
29
+
30
+ ${{ env.BODY }}
Original file line number Diff line number Diff line change
1
+ name : Release
2
+ on :
3
+ workflow_dispatch :
4
+ push :
5
+ paths : [CHANGELOG.md]
6
+ branches : [master]
7
+ jobs :
8
+ Publish :
9
+ name : Publish
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+ - run : |
14
+ source .github/scripts/changelog.sh
15
+ git fetch origin --tags
16
+ if [[ ! -z "$version" && -z "$(git tag -l "v$version")" ]]; then
17
+ git tag "v$major.$minor.$patch"
18
+ git tag "v$major.$minor" --force
19
+ git tag "v$major" --force
20
+ git push --tags --force
21
+ echo "BODY<<EOF" >> $GITHUB_ENV
22
+ echo "$(IFS=$'\n'; echo "${log[*]}")" >> $GITHUB_ENV
23
+ echo "EOF" >> $GITHUB_ENV
24
+ echo "TAG=v$version" >> $GITHUB_ENV
25
+ fi
26
+ shell: bash
27
+ - if : ${{ env.TAG != '' }}
28
+ uses : ncipollo/release-action@40bb172bd05f266cf9ba4ff965cb61e9ee5f6d01 # v1.9.0
29
+ with :
30
+ body : |
31
+ ${{ env.BODY }}
32
+ tag : ${{ env.TAG }}
33
+ token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
+ and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
+
7
+ ## [ Unreleased]
8
+
9
+ ## [ 1.0.0] - 2022-04-14
10
+ ### Added
11
+ - release workflows
12
+ - changelog
13
+
14
+ ### Changed
15
+ - the repository from https://github.com/coryschwartz/testground-github-action to https://github.com/testground/testground-github-action
Original file line number Diff line number Diff line change
1
+ * NOTE* : This repository was forked from https://github.com/coryschwartz/testground-github-action to continue its' active development (initially to include the following fix: https://github.com/coryschwartz/testground-github-action/pull/2 ).
2
+
1
3
# testground-github-action
2
4
3
5
Submit jobs to [ testground] ( https://testground.ai ) and view the outcome in Github.
27
29
steps:
28
30
- uses: actions/checkout@v2
29
31
- name: ${{ matrix.composition_file }}
30
- id:
32
+ id:
31
33
uses: coryschwartz/[email protected]
32
34
with:
33
35
backend_addr: ${{ matrix.backend_addr }}
Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ ln -s "${REAL_PLAN_DIR}" "${PLANSHOME}"
37
37
--metadata-branch " ${GITHUB_REF# refs/ heads/ } " \
38
38
--metadata-commit " ${GITHUB_SHA} " | tee run.out
39
39
TGID=$( awk ' /run is queued with ID/ {print $10}' < run.out)
40
+
41
+ # Make sure the we received a run ID
42
+ if [ -z " $TGID " ]
43
+ then
44
+ echo " ${OUTPUT_OUTCOME} failure/not_queued"
45
+ exit " ${FAILURE} "
46
+ fi
47
+
40
48
echo " ${OUTPUT_ID}${TGID} "
41
49
42
50
echo " Got testground ID ${TGID} "
You can’t perform that action at this time.
0 commit comments