From 2d822ea1be33456031ef41a339310406caa1dcfc Mon Sep 17 00:00:00 2001 From: smoia Date: Mon, 21 Mar 2022 15:51:23 +0100 Subject: [PATCH 1/2] Update auto settings and workflows --- .autorc | 17 +++++- .github/workflows/auto-release.yml | 78 ++++++++++++++-------------- .github/workflows/python-publish.yml | 50 +++++++++--------- 3 files changed, 80 insertions(+), 65 deletions(-) diff --git a/.autorc b/.autorc index 1ee8d27..c98d642 100644 --- a/.autorc +++ b/.autorc @@ -3,7 +3,8 @@ "git-tag", "conventional-commits", "first-time-contributor", - "released" + ["released", {"label": "Released", "prereleaseLabel": "Prereleased"}], + ["pr-body-labels", { "disabledLabels": ["release", "Release", "Released", "Prereleased", "Skip release"] }] ], "owner": "smoia", "repo": "nigsp", @@ -186,6 +187,20 @@ "releaseType": "none", "overwrite": true, "color": "#ffffff" + }, + { + "name": "Released", + "description": "This PR has been released!", + "releaseType": "none", + "overwrite": true, + "color": "#ffffff" + }, + { + "name": "Prereleased", + "description": "This PR has been released in a prerelease", + "releaseType": "none", + "overwrite": true, + "color": "#ffffff" } ] } \ No newline at end of file diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 0a6255b..d41d796 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -1,43 +1,43 @@ # # This workflows will create a release using auto when a PR is merged in master. -# name: Auto-release on PR merge +name: Auto-release on PR merge -# on: -# # ATM, this is the closest trigger to a PR merging -# push: -# branches: -# - master +on: + # ATM, this is the closest trigger to a PR merging + push: + branches: + - master -# jobs: -# auto-release: -# runs-on: ubuntu-18.04 -# # Set skip ci to avoid loops -# if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" -# # Set bash as default shell for jobs -# defaults: -# run: -# shell: bash -# steps: -# - name: Checkout source -# uses: actions/checkout@v2 -# with: -# # Fetch all history for all branches and tags -# fetch-depth: 0 -# # Use token with write access to the repo -# token: ${{ secrets.GH_TOKEN }} -# - name: Download and install latest auto -# env: -# # OS can be linux, macos, or win -# OS: linux -# # Retrieve URL of latest auto, download it, unzip it, and give exec permissions. -# run: | -# curl -vkL -o - $( curl -s https://api.github.com/repos/intuit/auto/releases/latest \ -# | grep browser_download_url | grep ${OS} | awk -F'"' '{print $4}') \ -# | gunzip > ~/auto -# chmod a+x ~/auto -# - name: Create release without version prefix -# env: -# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} -# # Run auto release, don't use 'v' prefix, and be verbose -# run: | -# ~/auto shipit --no-version-prefix -v +jobs: + auto-release: + runs-on: ubuntu-18.04 + # Set skip ci to avoid loops + if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" + # Set bash as default shell for jobs + defaults: + run: + shell: bash + steps: + - name: Checkout source + uses: actions/checkout@v2 + with: + # Fetch all history for all branches and tags + fetch-depth: 0 + # Use token with write access to the repo + token: ${{ secrets.GH_TOKEN }} + - name: Download and install latest auto + env: + # OS can be linux, macos, or win + OS: linux + # Retrieve URL of latest auto, download it, unzip it, and give exec permissions. + run: | + curl -vkL -o - $( curl -s https://api.github.com/repos/intuit/auto/releases/latest \ + | grep browser_download_url | grep ${OS} | awk -F'"' '{print $4}') \ + | gunzip > ~/auto + chmod a+x ~/auto + - name: Create release without version prefix + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + # Run auto release, don't use 'v' prefix, and be verbose + run: | + ~/auto shipit --no-version-prefix -v diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1a13b79..6c88158 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,32 +1,32 @@ # # This workflows will upload a Python Package using Twine when a release is created # # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries -# name: Upload Python Package +name: Upload Python Package -# on: -# release: -# types: [created] +on: + release: + types: [created] -# jobs: -# deploy: +jobs: + deploy: -# runs-on: ubuntu-18.04 + runs-on: ubuntu-18.04 -# steps: -# - name: Checkout source -# uses: actions/checkout@v2 -# - name: Set up Python -# uses: actions/setup-python@v2 -# with: -# python-version: '3.6' -# - name: Install dependencies -# run: | -# python -m pip install --upgrade pip -# pip install setuptools wheel twine -# - name: Build and publish -# env: -# TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} -# run: | -# python setup.py sdist bdist_wheel -# twine upload dist/* + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.6' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* From a0aaa7318e95d2fbde56729286da40f1c50e8181 Mon Sep 17 00:00:00 2001 From: smoia Date: Mon, 21 Mar 2022 15:53:59 +0100 Subject: [PATCH 2/2] Update owner in autorc --- .autorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.autorc b/.autorc index c98d642..ed745d5 100644 --- a/.autorc +++ b/.autorc @@ -6,7 +6,7 @@ ["released", {"label": "Released", "prereleaseLabel": "Prereleased"}], ["pr-body-labels", { "disabledLabels": ["release", "Release", "Released", "Prereleased", "Skip release"] }] ], - "owner": "smoia", + "owner": "MIPLabCH", "repo": "nigsp", "name": "Stefano Moia", "email": "s.moia.research@gmail.com",