Skip to content

Commit 25e1ada

Browse files
authored
Merge pull request #50 from netfoundry/release-v5.11.2
bump versions
2 parents 8dba3fb + 61947c9 commit 25e1ada

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@ jobs:
1919
build_pypi_and_docker:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v5
2323
with:
2424
fetch-depth: 0 # unshallow checkout enables setuptools_scm to infer PyPi version from Git
2525

2626
- name: Set up Python
27-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v6
2828
with:
29-
python-version: '3.7'
29+
python-version: '3.12'
3030

3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34-
pip install build
34+
pip install build setuptools
3535
3636
- name: Build Package
3737
run: python -m build
3838

3939
- name: Upload Wheel Artifact
40-
uses: actions/upload-artifact@v3
40+
uses: actions/upload-artifact@v4
4141
with:
4242
name: netfoundry-wheel-${{ github.run_id }}
4343
path: dist/netfoundry-*.whl
@@ -72,12 +72,15 @@ jobs:
7272
register-python-argcomplete nfctl
7373
7474
- name: Run the NF CLI demo to test installed version
75+
shell: bash
7576
env:
7677
NETFOUNDRY_CLIENT_ID: ${{ secrets.NETFOUNDRY_CLIENT_ID }}
7778
NETFOUNDRY_PASSWORD: ${{ secrets.NETFOUNDRY_PASSWORD }}
7879
NETFOUNDRY_OAUTH_URL: ${{ secrets.NETFOUNDRY_OAUTH_URL }}
7980
run: |
80-
set -x
81+
set -o xtrace
82+
set -o pipefail
83+
8184
nfctl config \
8285
general.network=$(nfctl demo --echo-name --prefix 'gh-${{ github.run_id }}') \
8386
general.yes=True \
@@ -98,7 +101,7 @@ jobs:
98101
delete network
99102
100103
- name: Publish Test Package
101-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
104+
uses: pypa/gh-action-pypi-publish@v1.13.0
102105
with:
103106
user: __token__
104107
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
@@ -120,38 +123,38 @@ jobs:
120123
121124
- name: Publish Release to PyPi
122125
if: github.event.action == 'published'
123-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
126+
uses: pypa/gh-action-pypi-publish@v1.13.0
124127
with:
125128
user: __token__
126129
password: ${{ secrets.PYPI_API_TOKEN }}
127130

128131
- name: Attach Wheel Artifact to GH Release
129132
if: ${{ github.event.action == 'published' }}
130-
uses: softprops/action-gh-release@v1
133+
uses: softprops/action-gh-release@v2
131134
with:
132135
files: dist/netfoundry-*.whl
133136
fail_on_unmatched_files: true
134137
generate_release_notes: true
135138

136139
- name: Set up QEMU
137-
uses: docker/setup-qemu-action@master
140+
uses: docker/setup-qemu-action@v3
138141
with:
139142
platforms: amd64,arm64
140143
# ignore arm/v7 (32bit) because unsupported by "cryptography" dep of
141144
# Ansible and demand seems unlikely
142145

143146
- name: Set up Docker BuildKit
144147
id: buildx
145-
uses: docker/setup-buildx-action@master
148+
uses: docker/setup-buildx-action@v3
146149

147150
- name: Login to Docker Hub
148-
uses: docker/login-action@v1
151+
uses: docker/login-action@v3
149152
with:
150153
username: ${{ secrets.DOCKER_HUB_API_USER }}
151154
password: ${{ secrets.DOCKER_HUB_API_TOKEN }}
152155

153156
- name: Build & Push Multi-Platform Container
154-
uses: docker/build-push-action@v2
157+
uses: docker/build-push-action@v6
155158
with:
156159
context: ${{ github.workspace }} # build context is workspace so we can copy artifacts from ./dist/
157160
file: ${{ github.workspace }}/docker/Dockerfile

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim-buster
1+
FROM python:3.12-slim-bookworm
22
COPY ./dist/netfoundry-*.whl /tmp/
33
RUN pip install --upgrade pip
44
RUN pip install /tmp/netfoundry-*.whl

netfoundry/ctl.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from xml.sax.xmlreader import InputSource
2626

2727
from jwt.exceptions import PyJWTError
28-
from milc import set_metadata # this function needed to set metadata immediately below
28+
# milc metadata will be set after cli import
2929
from pygments import highlight
3030
from pygments.formatters import Terminal256Formatter
3131
from pygments.lexers import get_lexer_by_name, load_lexer_from_file
@@ -42,10 +42,10 @@
4242
from .organization import Organization
4343
from .utility import DC_PROVIDERS, EMBED_NET_RESOURCES, IDENTITY_ID_PROPERTIES, MUTABLE_NET_RESOURCES, MUTABLE_RESOURCE_ABBREV, RESOURCE_ABBREV, RESOURCES, any_in, get_generic_resource_by_type_and_id, normalize_caseless, plural, propid2type, singular
4444

45-
# must precend import milc.cli
46-
set_metadata(version=f"v{netfoundry_version}", author="NetFoundry", name="nfctl")
47-
# this uses metadata set above
45+
# import milc cli
4846
from milc import cli, questions # noqa: E402
47+
# set milc options using new API
48+
cli.milc_options(name='nfctl', author='NetFoundry', version=f'v{netfoundry_version}')
4949
# this creates the config subcommand
5050
from milc.subcommand import config # noqa: F401,E402
5151

@@ -871,7 +871,7 @@ def delete(cli):
871871
sysexit(1)
872872

873873

874-
@cli.argument("-p", "--prefix", default=f"{cli.prog_name}-demo", help="choose a network name prefix to identify all of your demos")
874+
@cli.argument("-p", "--prefix", default="nfctl-demo", help="choose a network name prefix to identify all of your demos")
875875
@cli.argument("-j", "--jwt", action="store_boolean", default=True, help="save the one-time enroll token for each demo identity in the current directory")
876876
@cli.argument("-e", "--echo-name", arg_only=True, action="store_true", default=False, help="only echo a friendly network name then exit")
877877
@cli.argument("-s", "--size", default="medium", help=argparse.SUPPRESS) # troubleshoot scale-up instance size factor

0 commit comments

Comments
 (0)