-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
1b2d6e9
commit a9dc19b
Showing
5 changed files
with
100 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## What does this PR do? | ||
|
||
[Description here] | ||
|
||
## CHANGELOG | ||
|
||
- [CHANGED] Describe your change here. Look at CHANGELOG.md to see the format. |
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,39 @@ | ||
name: Prepare release | ||
|
||
on: | ||
pull_request: | ||
types: [ labeled ] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
prepare-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch the lastest release version | ||
id: fetch_latest_release | ||
uses: pozetroninc/github-action-get-latest-release@master | ||
with: | ||
repository: ${{ github.repository }} | ||
excludes: prerelease, draft | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: pusher/actions | ||
token: ${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }} | ||
path: .github/actions | ||
- uses: ./.github/actions/prepare-version-bump | ||
id: bump | ||
with: | ||
current_version: ${{ steps.fetch_latest_release.outputs.release }} | ||
changelog_file: CHANGELOG.md | ||
- name: "Bump version in README.md" | ||
run: | | ||
sed -i 's/${{ steps.bump.outputs.current_version }}/${{ steps.bump.outputs.new_version }}/1' README.md | ||
echo "${{steps.bump.outputs.new_version}}" > .version | ||
git add README.md .version CHANGELOG.md | ||
git commit -m "Bump to version ${{ steps.bump.outputs.new_version }}" | ||
git push |
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,53 @@ | ||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
check-release-tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Prepare tag | ||
id: prepare_tag | ||
run: | | ||
export TAG="$(cat .version)" | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
export CHECK_TAG=$(git tag | grep $TAG) | ||
if [[ $CHECK_TAG ]]; then | ||
echo "Skipping because release tag already exists" | ||
exit 1 | ||
fi | ||
- name: Output | ||
id: release_output | ||
if: ${{ steps.prepare_tag.outcome == 'success' }} | ||
run: | | ||
echo "::set-output name=tag::${{ env.TAG }}" | ||
outputs: | ||
tag: ${{ steps.release_output.outputs.tag }} | ||
|
||
create-github-release: | ||
runs-on: ubuntu-latest | ||
needs: check-release-tag | ||
if: ${{ needs.check-release-tag.outputs.tag }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Prepare tag | ||
run: | | ||
export TAG=${{ needs.check-release-tag.outputs.tag }} | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
- name: Setup git | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Pusher CI" | ||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.TAG }} | ||
release_name: ${{ env.TAG }} | ||
draft: false | ||
prerelease: false |
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
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