Skip to content

Commit 665196a

Browse files
authored
allow independent py/js package releases (#949)
* allow independent py/js package releases * misc fixes
1 parent 2fc8228 commit 665196a

17 files changed

+290
-411
lines changed

.github/workflows/.nox-session.yml

+14-11
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ name: Nox Session
33
on:
44
workflow_call:
55
inputs:
6+
job-name:
7+
required: true
8+
type: string
69
nox-args:
710
required: true
811
type: string
9-
session-args:
12+
nox-env:
13+
required: false
14+
type: string
15+
default: "{}"
16+
nox-session-args:
1017
required: false
1118
type: string
1219
runs-on-array:
@@ -17,32 +24,28 @@ on:
1724
required: false
1825
type: string
1926
default: '["3.x"]'
20-
job-name:
21-
required: false
22-
type: string
23-
default: python-{0} {1}
2427

2528
jobs:
2629
nox-session:
2730
name: ${{ format(inputs.job-name, matrix.python-version, matrix.runs-on) }}
2831
strategy:
2932
matrix:
30-
runs-on: ${{fromJson(inputs.runs-on-array)}}
31-
python-version: ${{fromJson(inputs.python-version-array)}}
33+
runs-on: ${{ fromJson(inputs.runs-on-array) }}
34+
python-version: ${{ fromJson(inputs.python-version-array) }}
3235
runs-on: ${{ matrix.runs-on }}
3336
steps:
3437
- uses: actions/checkout@v2
3538
- uses: actions/setup-node@v2
3639
with:
3740
node-version: "14.x"
38-
- name: Install Specific NPM Version
41+
- name: Pin NPM Version
3942
run: npm install -g [email protected]
4043
- name: Use Python ${{ matrix.python-version }}
4144
uses: actions/setup-python@v2
4245
with:
4346
python-version: ${{ matrix.python-version }}
4447
- name: Install Python Dependencies
4548
run: pip install -r requirements/nox-deps.txt
46-
- name: Run Tests
47-
env: { "CI": "true" }
48-
run: nox ${{ inputs.nox-args }} --stop-on-first-error -- ${{ inputs.session-args }}
49+
- name: Run Sessions
50+
env: ${{ fromJson(inputs.nox-env) }}
51+
run: nox ${{ inputs.nox-args }} --stop-on-first-error -- ${{ inputs.nox-session-args }}

.github/workflows/codeql-analysis.yml

+30-30
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: codeql
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [main]
2020
schedule:
21-
- cron: '43 3 * * 3'
21+
- cron: "43 3 * * 3"
2222

2323
jobs:
2424
analyze:
@@ -32,40 +32,40 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript', 'python' ]
35+
language: ["javascript", "python"]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3737
# Learn more:
3838
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3939

4040
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v2
41+
- name: Checkout repository
42+
uses: actions/checkout@v2
4343

44-
# Initializes the CodeQL tools for scanning.
45-
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
47-
with:
48-
languages: ${{ matrix.language }}
49-
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
51-
# Prefix the list here with "+" to use these queries and those in the config file.
52-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v1
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5353

54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v1
5858

59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 https://git.io/JvXDl
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
6161

62-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63-
# and modify them (or add more) to build your code if your project
64-
# uses a compiled language
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
6565

66-
#- run: |
67-
# make bootstrap
68-
# make release
66+
#- run: |
67+
# make bootstrap
68+
# make release
6969

70-
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v1

.github/workflows/deploy-docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflows will upload a Python Package using Twine when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33

4-
name: Deploy Documentation
4+
name: deploy-docs
55

66
on:
77
push:

.github/workflows/publish-js.yml

-31
This file was deleted.

.github/workflows/publish-py.yml

-38
This file was deleted.

.github/workflows/publish.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This workflows will upload a Javscript Package using NPM to npmjs.org when a release is created
2+
# For more information see: https://docs.github.com/en/actions/guides/publishing-nodejs-packages
3+
4+
name: publish
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
publish:
12+
uses: ./.github/workflows/.nox-session.yml
13+
with:
14+
job-name: "publish"
15+
nox-args: "-s publish"
16+
nox-env: >
17+
{
18+
"NODE_AUTH_TOKEN": "${{ secrets.NPM_AUTOMATION_TOKEN }}",
19+
"PYPI_USERNAME": "${{ secrets.PYPI_USERNAME }}",
20+
"PYPI_PASSWORD": "${{ secrets.PYPI_PASSWORD }}"
21+
}

.github/workflows/test.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ jobs:
1616
with:
1717
job-name: "python-{0}"
1818
nox-args: "-t check-python"
19-
session-args: "--pytest --maxfail=3 --reruns 3"
19+
nox-session-args: "--pytest --maxfail=3 --reruns 3"
2020
python-environments:
2121
uses: ./.github/workflows/.nox-session.yml
2222
with:
23+
job-name: "python-{0} {1}"
2324
nox-args: "-s check-python-tests"
24-
session-args: "--no-cov --pytest --maxfail=3 --reruns 3"
25+
nox-session-args: "--no-cov --pytest --maxfail=3 --reruns 3"
2526
runs-on-array: '["ubuntu-latest", "macos-latest", "windows-latest"]'
2627
python-version-array: '["3.7", "3.8", "3.9", "3.10", "3.11"]'
2728
docs:

VERSION

-1
This file was deleted.

0 commit comments

Comments
 (0)