From 0b925a383816911835bff3a3cf5522ce79e2e87a Mon Sep 17 00:00:00 2001 From: "hasnain2808@gmail.com" Date: Wed, 3 Feb 2021 10:21:40 +0530 Subject: [PATCH 1/3] chore: Add Semantic Release --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ .releaserc | 25 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ff2f7879 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release +on: + push: + branches: + - v5.x +jobs: + release: + name: Release + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Set-up semantic-release plugins + run: npm install @semantic-release/git @semantic-release/exec --no-save + - name: Set-up python build env + run: pip install wheel twine + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + TEST_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + run: npx semantic-release diff --git a/.releaserc b/.releaserc new file mode 100644 index 00000000..7d97606d --- /dev/null +++ b/.releaserc @@ -0,0 +1,25 @@ +{ + "branches": ["v5.x"], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + ["@semantic-release/exec", { + "prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" bench/__init__.py' + }], + ["@semantic-release/exec", { + "prepareCmd": "python setup.py bdist_wheel --universal" + }], + ["@semantic-release/git", { + "assets": ["bench/__init__.py"], + "message": "chore(release): Bumped to Version ${nextRelease.version}\n\n${nextRelease.notes}" + }], + ["@semantic-release/github", { + "assets": [ + {"path": "dist/*"}, + ] + }], + ["@semantic-release/exec", { + "publishCmd": "python -m twine upload -r testpypi dist/* -u $TEST_PYPI_USERNAME -p $TEST_PYPI_PASSWORD" + }] + ] +} From 392bfb48f061b3e4f23400dedec9ff4c420cec33 Mon Sep 17 00:00:00 2001 From: "hasnain2808@gmail.com" Date: Thu, 4 Feb 2021 09:48:56 +0530 Subject: [PATCH 2/3] chore: testpypi to pypi --- .github/workflows/release.yml | 4 ++-- .releaserc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff2f7879..0f5c3ef9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,6 @@ jobs: - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} - TEST_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + TEST_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + TEST_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} run: npx semantic-release diff --git a/.releaserc b/.releaserc index 7d97606d..7b4a238f 100644 --- a/.releaserc +++ b/.releaserc @@ -19,7 +19,7 @@ ] }], ["@semantic-release/exec", { - "publishCmd": "python -m twine upload -r testpypi dist/* -u $TEST_PYPI_USERNAME -p $TEST_PYPI_PASSWORD" + "publishCmd": "python -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD" }] ] } From 34a56287b51c17b8d0642dd3ea1ac69806a4103a Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 4 Feb 2021 12:57:17 +0530 Subject: [PATCH 3/3] style: Re-worded tasks and fixed inconsistent spacing --- .github/workflows/release.yml | 20 +++++++------- .releaserc | 50 +++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f5c3ef9..18103def 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: Generate Semantic Release and publish on PyPI on: push: branches: @@ -8,21 +8,21 @@ jobs: name: Release runs-on: ubuntu-18.04 steps: - - name: Checkout + - name: Checkout Entire Repository uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Setup Node.js + - name: Setup Node.js v12 uses: actions/setup-node@v1 with: node-version: 12 - - name: Set-up semantic-release plugins - run: npm install @semantic-release/git @semantic-release/exec --no-save - - name: Set-up python build env - run: pip install wheel twine - - name: Release + - name: Setup dependencies + run: | + npm install @semantic-release/git @semantic-release/exec --no-save + pip install wheel twine + - name: Create Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TEST_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TEST_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + TEST_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + TEST_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} run: npx semantic-release diff --git a/.releaserc b/.releaserc index 7b4a238f..43cc0109 100644 --- a/.releaserc +++ b/.releaserc @@ -1,25 +1,35 @@ { "branches": ["v5.x"], - "plugins": [ + "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", - ["@semantic-release/exec", { - "prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" bench/__init__.py' - }], - ["@semantic-release/exec", { - "prepareCmd": "python setup.py bdist_wheel --universal" - }], - ["@semantic-release/git", { - "assets": ["bench/__init__.py"], - "message": "chore(release): Bumped to Version ${nextRelease.version}\n\n${nextRelease.notes}" - }], - ["@semantic-release/github", { - "assets": [ - {"path": "dist/*"}, - ] - }], - ["@semantic-release/exec", { - "publishCmd": "python -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD" - }] - ] + [ + "@semantic-release/exec", { + "prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" bench/__init__.py' + } + ], + [ + "@semantic-release/exec", { + "prepareCmd": "python setup.py bdist_wheel --universal" + } + ], + [ + "@semantic-release/git", { + "assets": ["bench/__init__.py"], + "message": "chore(release): Bumped to Version ${nextRelease.version}\n\n${nextRelease.notes}" + } + ], + [ + "@semantic-release/github", { + "assets": [ + {"path": "dist/*"}, + ] + } + ], + [ + "@semantic-release/exec", { + "publishCmd": "python -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD" + } + ] + ] }