Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump actions/upload-artifact from 3 to 4 #14

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .bumpversion.cfg

This file was deleted.

6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATES/bug.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
* detectree version:
* Python version:
* Operating system:
- detectree version:
- Python version:
- Operating system:

### Description

Expand Down
11 changes: 11 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Config for Dependabot updates. See Documentation here:
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# Update GitHub actions in workflows
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates to GitHub Actions every weekday
schedule:
interval: "daily"
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Before you proceed, review the contributing guidelines in the "Pull request guid

In this pull request, please include:

* a reference to related issue(s)
* a description of the changes proposed in the pull request
* an example code snippet illustrating usage of the new functionality
- a reference to related issue(s)
- a description of the changes proposed in the pull request
- an example code snippet illustrating usage of the new functionality
69 changes: 0 additions & 69 deletions .github/workflows/dev.yml

This file was deleted.

131 changes: 131 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: release

on:
push:
tags:
- 'v*'

jobs:
build_sdist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: build source tarball
run: |
python -m build --sdist
twine check --strict dist/*

- uses: actions/upload-artifact@v4
with:
path: dist/*

build_wheels:
name: wheel on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# temporarily ignoring binary wheels for windows until pythran issues are fixed
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

# see https://github.com/pypa/cibuildwheel/issues/933
# - uses: pypa/cibuildwheel@v2

# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: install cibuildwheel
run: python -m pip install

- name: build wheels
run: python -m cibuildwheel --output-dir wheelhouse

- name: upload wheels
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl

publish_dev_build:
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://pypi.org/p/detectree
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: publish to test pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true

release:
needs: [publish_dev_build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/detectree
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
# see https://github.com/softprops/action-gh-release/issues/236
contents: write

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: generate change log
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
unreleased: true
addSections: '{"documentation":{"prefix":"**Documentation:**","labels":["documentation"]}}'
sinceTag: v0.1.0
output: RELEASE-CHANGELOG.md

- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: create github release
uses: softprops/action-gh-release@v1
with:
body_path: ./RELEASE-CHANGELOG.md
files: dist/*.whl
draft: false
prerelease: false

- name: publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
58 changes: 0 additions & 58 deletions .github/workflows/release_to_pypi.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: tests

on:
pull_request:
branches:
- "*"

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.12"

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v1
with:
environment-name: test-env
create-args: >-
python=${{ matrix.python-version }}
pip

- name: install dependencies
run: pip install tox tox-gh-actions

- name: test with tox
run: tox
env:
CONDA_EXE: mamba

- name: upload coverage reports to Codecov
uses: codecov/codecov-action@v3

- name: list files
run: ls -l .
Loading
Loading