From f47ed7dbd36f2ac52c8bd8dddc2219334c499e7f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 13 Dec 2024 10:21:41 -0500 Subject: [PATCH] Added base files for intuit auto release --- .autorc | 16 ++++++++++++++ .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .autorc create mode 100644 .github/workflows/release.yml diff --git a/.autorc b/.autorc new file mode 100644 index 0000000..27720cc --- /dev/null +++ b/.autorc @@ -0,0 +1,16 @@ +{ + "onlyPublishWithReleaseLabel": true, + "baseBranch": "master", + "author": "DANDI Bot ", + "noVersionPrefix": true, + "plugins": [ + "git-tag", + [ + "exec", + { + "afterRelease": "python -m build && twine upload dist/*" + } + ], + "released" + ] +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f5c6814 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Auto-release on PR merge + +on: + # ATM, this is the closest trigger to a PR merging + push: + branches: + - master + +jobs: + auto-release: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download latest auto + run: | + auto_download_url="$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/latest | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')" + wget -O- "$auto_download_url" | gunzip > ~/auto + chmod a+x ~/auto + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Install build & twine + run: python -m pip install build twine + + - name: Create release + run: ~/auto shipit -vv + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + +# vim:set sts=2: