Skip to content

Commit

Permalink
Add auto release (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ste1hi authored May 8, 2024
1 parent 0bed3a6 commit 1610f2f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
sudo apt-get update
sudo apt-get install gdb
- name: Lint and test
run: |
flake8 OiRunner/ tests/ --count --statistics --max-line-length=127
mypy OiRunner/
coverage run --source OiRunner -m unittest
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,5 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

token
token
*.html
2 changes: 1 addition & 1 deletion tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def wait():
with mock.patch("subprocess.Popen", return_value=new_mock):
self.runner.run()

def test_nojudge(self):
def test_not_judge(self):
sys.argv = ["BetterRunner.py", "test"]
self.runner.cmd_parse()
self.runner.args.onlyinput = True
Expand Down

0 comments on commit 1610f2f

Please sign in to comment.