forked from amplify-education/python-hcl2
-
Notifications
You must be signed in to change notification settings - Fork 3
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
5ac9ac3
commit 3a34268
Showing
6 changed files
with
71 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,67 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
|
||
bump-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- uses: dschep/install-pipenv-action@v1 | ||
- name: Install dependencies | ||
run: | | ||
pipenv install --dev | ||
- name: update docs and bump version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git fetch --tags | ||
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
echo "latest tag: $latest_tag" | ||
new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}') | ||
echo "new tag: $new_tag" | ||
## update python version | ||
echo "__version__ = '$new_tag'" > 'hcl2/version.py' | ||
git commit --reuse-message=HEAD@{1} hcl2/version.py || echo "No changes to commit" | ||
git push origin | ||
git tag $new_tag | ||
git push origin $new_tag | ||
publish-package: | ||
needs: bump-version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- uses: dschep/install-pipenv-action@v1 | ||
- name: Install dependencies | ||
run: | | ||
pipenv install --dev | ||
- name: create python package | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git fetch --tags | ||
git pull | ||
pipenv run python setup.py sdist bdist_wheel | ||
- name: Publish a Python distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
- name: sleep and wait for package to refresh | ||
run: | | ||
sleep 2m |
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,4 +1 @@ | ||
"""Place of record for the package version""" | ||
|
||
__version__ = "0.3.0" | ||
__git_hash__ = "GIT_HASH" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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