From 96401377d88fcc91f8a6a59a4a57126d4bafcc2f Mon Sep 17 00:00:00 2001 From: Ayrton Bourn Date: Sat, 27 Mar 2021 20:07:10 +0000 Subject: [PATCH 1/2] Create tagged-release.yml --- .github/workflows/tagged-release.yml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/tagged-release.yml diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml new file mode 100644 index 0000000..973b638 --- /dev/null +++ b/.github/workflows/tagged-release.yml @@ -0,0 +1,51 @@ +name: "tagged-release" + +on: + push: + tags: + - "v*" + +jobs: + tagged-release: + name: "Auto-Release" + 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 + + - name: Install the module + shell: bash + run: | + python -m pip install --upgrade pip + pip install wheel + pip install -e . + + - name: Get tag version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Set PyPi version as tag + run: python -m moepy.utils set-current-package-version ${{ steps.get_version.outputs.VERSION }} + + - name: Create latest distribution + run: | + pip install -e . # reinstalling with new version number + python setup.py sdist bdist_wheel + - name: Publish package to PyPi + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + + - name: Update release on GitHub + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + LICENSE.txt From a0f9a6b6ab9280bcfcdf76753c6bcef9a2fe1b21 Mon Sep 17 00:00:00 2001 From: Ayrton Bourn Date: Sat, 27 Mar 2021 20:10:26 +0000 Subject: [PATCH 2/2] Update tagged-release.yml --- .github/workflows/tagged-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 973b638..be6b4cc 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -30,7 +30,7 @@ jobs: run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - name: Set PyPi version as tag - run: python -m moepy.utils set-current-package-version ${{ steps.get_version.outputs.VERSION }} + run: python -m moepy.cicd set-current-package-version ${{ steps.get_version.outputs.VERSION }} - name: Create latest distribution run: |