-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jon Elverkilde
committed
Mar 3, 2021
1 parent
d3a0186
commit 8a1deaa
Showing
1 changed file
with
4 additions
and
25 deletions.
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 |
---|---|---|
|
@@ -5,52 +5,31 @@ on: | |
branches: [ master ] | ||
|
||
jobs: | ||
prepare-release: | ||
name: Prepare release | ||
create-release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup git | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Pusher CI" | ||
git fetch | ||
git checkout ${{ github.event.pull_request.head.ref }} | ||
- name: Prepare package | ||
run: | | ||
export NEW_VERSION=$(grep "<Version>.*</Version>" Root.Build.props | cut -d'>' -f 2 | cut -d'<' -f 1) | ||
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV | ||
- name: Tag release | ||
run: git tag ${{ env.VERSION }} | ||
- name: Push | ||
run: git push --tags | ||
|
||
create-release: | ||
needs: prepare-release | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Prepare description | ||
run: | | ||
csplit -s CHANGELOG.md "/##/" {1} | ||
cat xx01 > CHANGELOG.tmp | ||
- name: Prepare tag | ||
run: | | ||
export REF=${{ github.ref }} | ||
export TAG=${REF##*/} | ||
export TAG=$(head -1 CHANGELOG.tmp | cut -d' ' -f2) | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
- name: Create Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.TAG }} | ||
release_name: Release ${{ env.TAG }} | ||
release_name: ${{ env.TAG }} | ||
body_path: CHANGELOG.tmp | ||
draft: false | ||
prerelease: false |