-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from testground/release
Release
- Loading branch information
Showing
6 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
file="./CHANGELOG.md" | ||
regex='^## \[([0-9]+)\.([0-9]+)\.([0-9]+)\] - ([0-9]{4}-[0-9]{2}-[0-9]{2})$' | ||
|
||
version='' | ||
log=() | ||
|
||
while read line; do | ||
if [[ $line =~ $regex ]]; then | ||
if [[ -z "$version" ]]; then | ||
major="${BASH_REMATCH[1]}" | ||
minor="${BASH_REMATCH[2]}" | ||
patch="${BASH_REMATCH[3]}" | ||
version="$major.$minor.$patch" | ||
date="${BASH_REMATCH[4]}" | ||
else | ||
break | ||
fi | ||
elif [[ ! -z "$version" ]]; then | ||
log+=("$line") | ||
fi | ||
done <<< "$(cat "$file")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Pre Release | ||
on: | ||
pull_request: | ||
paths: [CHANGELOG.md] | ||
branches: [master] | ||
jobs: | ||
Post-Comment: | ||
name: Post Comment | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
source .github/scripts/changelog.sh | ||
git fetch origin --tags | ||
if [[ ! -z "$version" && -z "$(git tag -l "v$version")" ]]; then | ||
echo "BODY<<EOF" >> $GITHUB_ENV | ||
echo "$(IFS=$'\n'; echo "${log[*]}")" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
echo "TAG=v$version" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
- if: ${{ env.TAG != '' }} | ||
uses: marocchino/sticky-pull-request-comment@82e7a0d3c51217201b3fedc4ddde6632e969a477 # v2.1.1 | ||
with: | ||
header: pre-release | ||
recreate: true | ||
message: | | ||
## ${{ env.TAG }} | ||
${{ env.BODY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: [CHANGELOG.md] | ||
branches: [master] | ||
jobs: | ||
Publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
source .github/scripts/changelog.sh | ||
git fetch origin --tags | ||
if [[ ! -z "$version" && -z "$(git tag -l "v$version")" ]]; then | ||
git tag "v$major.$minor.$patch" | ||
git tag "v$major.$minor" --force | ||
git tag "v$major" --force | ||
git push --tags --force | ||
echo "BODY<<EOF" >> $GITHUB_ENV | ||
echo "$(IFS=$'\n'; echo "${log[*]}")" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
echo "TAG=v$version" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
- if: ${{ env.TAG != '' }} | ||
uses: ncipollo/release-action@40bb172bd05f266cf9ba4ff965cb61e9ee5f6d01 # v1.9.0 | ||
with: | ||
body: | | ||
${{ env.BODY }} | ||
tag: ${{ env.TAG }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
## [1.0.0] - 2022-04-14 | ||
### Added | ||
- release workflows | ||
- changelog | ||
|
||
### Changed | ||
- the repository from https://github.com/coryschwartz/testground-github-action to https://github.com/testground/testground-github-action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
*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). | ||
|
||
# testground-github-action | ||
|
||
Submit jobs to [testground](https://testground.ai) and view the outcome in Github. | ||
|
@@ -27,7 +29,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
- name: ${{ matrix.composition_file }} | ||
id: | ||
id: | ||
uses: coryschwartz/[email protected] | ||
with: | ||
backend_addr: ${{ matrix.backend_addr }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters