-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release-As: 1.7.0
- Loading branch information
Showing
9 changed files
with
65 additions
and
118 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,39 @@ | ||
# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally. | ||
# Contact @moabu | ||
name: release | ||
on: | ||
push: | ||
paths: | ||
- __version__.py | ||
branches-ignore: | ||
- master | ||
- main | ||
tags-ignore: | ||
- "*" | ||
branches: | ||
- "4.4" | ||
# below branch is triggered by jenkins which triggers dev image | ||
- update-source-build-date | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
|
||
release-simple-pr: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.7] | ||
|
||
fail-fast: false | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
sudo apt-get update | ||
sudo apt-get install ruby | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
|
||
- name: Get version | ||
id: get_version | ||
run: | | ||
mkdir /home/runner/work/test | ||
cp -r . /home/runner/work/test/ | ||
cd /home/runner/work/test/ | ||
echo "::set-output name=version::$(python3 -c 'import __version__ ; print(__version__.__version__)')" | ||
echo "::set-output name=pversion::$(python3 -c 'import __version__ ; print(__version__.__previous_version__)')" | ||
echo "::set-output name=gituser::$(python3 -c 'import os ; REPO = os.environ.get("GITHUB_REPOSITORY") ; print(str(REPO).split("/")[0])')" | ||
echo "::set-output name=gitproject::$(python3 -c 'import os ; REPO = os.environ.get("GITHUB_REPOSITORY") ; print(str(REPO).split("/")[1])')" | ||
echo "::set-output name=gitbranch::$(python3 -c 'import os ; BRANCH = os.environ.get("GITHUB_REF") ; print(str(BRANCH).split("/")[2])')" | ||
echo "::set-output name=releasedate::$(date +'%d-%m-%Y')" | ||
fetch-depth: 0 | ||
|
||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v4 | ||
with: | ||
gpg_private_key: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Install Changelog autogenerator | ||
run: | | ||
cd /home/runner/work/test/ | ||
sudo gem install github_changelog_generator | ||
github_changelog_generator --user ${{ steps.get_version.outputs.gituser }} --project ${{ steps.get_version.outputs.gitproject }} --date-format "%m/%d/%Y" --header-label "# Release Notes" --output release_notes.md --token ${{ secrets.token }} --include-labels ${{ steps.get_version.outputs.gitbranch }} --since-tag ${{ steps.get_version.outputs.pversion }} --author false | ||
sed -i '$ d' release_notes.md | ||
github_changelog_generator --user ${{ steps.get_version.outputs.gituser }} --project ${{ steps.get_version.outputs.gitproject }} --date-format "%m/%d/%Y" --token ${{ secrets.token }} --author false | ||
sed -i '$ d' CHANGELOG.md | ||
- name: Read CHANGELOG | ||
id: changelog | ||
- name: Configure Git | ||
run: | | ||
release_notes=$(sed -e '1,6d;' /home/runner/work/test/release_notes.md) | ||
release_notes="${release_notes//'%'/'%25'}" | ||
release_notes="${release_notes//$'\n'/'%0A'}" | ||
release_notes="${release_notes//$'\r'/'%0D'}" | ||
echo "::set-output name=body::$release_notes" | ||
cp /home/runner/work/test/CHANGELOG.md . | ||
git config user.name "mo-auto" | ||
git config user.email "[email protected]" | ||
git config --global user.signingkey "${{ steps.import_gpg.outputs.keyid }}" | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@master | ||
env: | ||
# in order for this to trigger proceeding action the token cannot be github default token. | ||
GITHUB_TOKEN: ${{ secrets.MOWORKFLOWTOKEN }} | ||
- uses: google-github-actions/[email protected] | ||
id: release-please | ||
with: | ||
tag_name: ${{ steps.get_version.outputs.version }} | ||
release_name: ${{ steps.get_version.outputs.version }} | ||
body: | | ||
# Release Notes | ||
## [${{ steps.get_version.outputs.version }}](https://github.com/${{ steps.get_version.outputs.gituser }}/${{ steps.get_version.outputs.gitproject }}/tree/${{ steps.get_version.outputs.version }}) (${{ steps.get_version.outputs.releasedate }}) | ||
[Full Changelog](https://github.com/${{ steps.get_version.outputs.gituser }}/${{ steps.get_version.outputs.gitproject }}/compare/${{ steps.get_version.outputs.pversion }}...${{ steps.get_version.outputs.version }}) | ||
${{ steps.changelog.outputs.body }} | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.MOWORKFLOWTOKEN }} | ||
release-type: simple |
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
Binary file not shown.
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
Oops, something went wrong.