Skip to content

Commit

Permalink
ci: add build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb-sti1 committed Nov 12, 2024
1 parent 924ce0a commit bea4dc8
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and publish

on:
push:
branches: [ "master" ]
pull_request:

jobs:
build:
name: Build rmtree
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build
run: python -m build
- uses: actions/upload-artifact@v4
with:
name: rmtree
path: dist/rmtree-*-py3-none-any.whl
if-no-files-found: error
retention-days: 3
test-build:
name: Test wheel file with pipx
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Install pipx
run: |
sudo apt update
sudo apt install pipx
pipx ensurepath
- uses: actions/download-artifact@v4
with:
name: rmtree
- name: Test rmtree.whl
run: |
pipx install ./rmtree-*-py3-none-any.whl
rmtree -h
# publish: # TODO use https://github.com/TriPSs/conventional-changelog-action & https://github.com/marketplace/actions/release-please-action ?
# name: Publish new release
# runs-on: ubuntu-latest
# needs: [test, build]
# permissions:
# contents: write
# if: ${{ github.ref_name == 'master' || github.ref_name == 'dev' }}
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v4
# with:
# name: rmtree
# - name: Publish release
# uses: softprops/action-gh-release@v2
# with:
# name: Release 0.0.2
# files: rmtree-*-py3-none-any.whl
# draft: ${{ github.ref_name != 'master' && github.ref_name != 'dev' }}
# prerelease: ${{ github.ref_name != 'master' }}
# target_commitish: ${{ github.head_ref || github.ref_name }}
# tag_name: 0.0.2
# generate_release_notes: true

0 comments on commit bea4dc8

Please sign in to comment.