Skip to content

Commit 0d2baa0

Browse files
committed
chore: switch to github actions
1 parent 5f76e41 commit 0d2baa0

File tree

6 files changed

+389
-30
lines changed

6 files changed

+389
-30
lines changed

.github/workflows/main.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
main:
11+
name: Test and release
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- name: Set up Python 3.9
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.9
22+
- name: Install Poetry
23+
uses: snok/[email protected]
24+
with:
25+
virtualenvs-in-project: true
26+
- name: Setup cache
27+
id: cached-poetry-dependencies
28+
uses: actions/cache@v2
29+
with:
30+
path: .venv
31+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
32+
- name: Install dependencies
33+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
34+
run: poetry install
35+
- name: Run tests
36+
run: poetry run pytest -v --benchmark-enable
37+
- name: Check formatting
38+
run: poetry run black --check nbtlib tests examples
39+
- name: Release
40+
if: |
41+
github.repository == 'vberlier/nbtlib'
42+
&& github.event_name == 'push'
43+
&& github.ref == 'refs/heads/main'
44+
env:
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
47+
run: |
48+
git config --global user.name "github-actions"
49+
git config --global user.email "[email protected]"
50+
poetry run semantic-release publish -v DEBUG -D commit_author="github-actions <[email protected]>"

.travis.yml

-28
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# nbtlib
22

3-
[![Build Status](https://travis-ci.com/vberlier/nbtlib.svg?branch=master)](https://travis-ci.com/vberlier/nbtlib)
3+
[![GitHub Actions](https://github.com/vberlier/nbtlib/workflows/CI/badge.svg)](https://github.com/vberlier/nbtlib/actions)
44
[![PyPI](https://img.shields.io/pypi/v/nbtlib.svg)](https://pypi.org/project/nbtlib/)
55
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nbtlib.svg)](https://pypi.org/project/nbtlib/)
66

0 commit comments

Comments
 (0)