Skip to content

Commit e1a52ba

Browse files
author
James Reynolds
committed
Testing github actions
1 parent aef3195 commit e1a52ba

File tree

2 files changed

+38
-14
lines changed

2 files changed

+38
-14
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build python-jamf
1+
name: Build and test python-jamf
22
on:
33
push:
44
branches: [ main ]
@@ -8,7 +8,7 @@ jobs:
88
build:
99
strategy:
1010
matrix:
11-
os: [ubuntu-latest, macos-10.15, macos-11]
11+
os: [ ubuntu-latest, macos-10.15, macos-11 ]
1212
python-version: [ '3.7', '3.8', '3.9', 'pypy-3.7' ]
1313
name: Build on ${{ matrix.os }} using ${{ matrix.python-version }}
1414
runs-on: ${{ matrix.os }}
@@ -31,6 +31,16 @@ jobs:
3131
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3232
- name: Run Unit Tests
3333
run: python -m unittest discover -s tests -p '*_test.py'
34+
codeql:
35+
name: Run CodeQL
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout sources
39+
uses: actions/checkout@v2
40+
- name: Initialize Python 3.7
41+
uses: actions/setup-python@v2
42+
with:
43+
python-version: 3.7
3444
- name: Initialize CodeQL
3545
uses: github/codeql-action/init@v1
3646
with:

.github/workflows/python-package.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
name: Build python-jamf and publish to PyPI
1+
name: Build and publish python-jamf to Github and PyPI
22
on:
3-
release:
4-
types: [ published ]
5-
strategy:
6-
matrix:
7-
os: [ubuntu-latest, macos-10.15, macos-11]
8-
python-version: [ '3.7', '3.8', '3.9', 'pypy-3.7' ]
3+
push:
4+
tags:
5+
- '*'
96
jobs:
107
build:
11-
name: Build on ${{ matrix.os }} using ${{ matrix.python-version }}
12-
runs-on: ${{ matrix.os }}
8+
name: Build
9+
runs-on: ubuntu-latest
1310
steps:
1411
- name: Checkout sources
1512
uses: actions/checkout@v2
@@ -40,8 +37,25 @@ jobs:
4037
python-version: 3.7
4138
- name: Build binary wheel and a source tarball
4239
run: python setup.py sdist
43-
- name: Publish distribution to Test PyPI
40+
- name: Publish to PyPI
4441
uses: pypa/gh-action-pypi-publish@master
4542
with:
46-
password: ${{ secrets.test_pypi_password }}
47-
repository_url: https://test.pypi.org/legacy/
43+
password: ${{ secrets.TEST_PYPI_PASSWORD }}
44+
repository_url: https://test.pypi.org/legacy/
45+
- name: Create GitHub Release
46+
uses: actions/create-release@v1
47+
id: create_release
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
tag_name: ${{ github.ref }}
52+
release_name: ${{ github.ref }}
53+
draft: true
54+
prerelease: false
55+
- name: Publish to GitHub
56+
uses: xresloader/upload-to-github-release@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
file: "dist/*"
61+
release_id: ${{ steps.create_release.outputs.id }}

0 commit comments

Comments
 (0)