Skip to content

Commit 5b10693

Browse files
authored
Merge pull request #26 from WarnerMedia/fix/rebase-2.8.2
Rebase onto Nike 2.8.2 release
2 parents b9f5a1e + 91d0c17 commit 5b10693

29 files changed

+1928
-279
lines changed

.github/workflows/binaries.yml

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,111 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
build:
14+
build-x64:
1515
strategy:
16+
fail-fast: false
1617
matrix:
1718
os: [ubuntu-latest, macos-latest, windows-latest]
18-
arch: [x64, arm64]
1919
runs-on: ${{ matrix.os }}
20-
name: Build on ${{ matrix.os }} (${{ matrix.arch }})
20+
name: Build on ${{ matrix.os }}
2121
steps:
2222
- name: Checkout code
2323
uses: actions/checkout@v4
2424
- name: Set up Python
2525
uses: actions/setup-python@v5
2626
with:
27-
python-version: '3.11'
28-
architecture: ${{ matrix.arch }}
27+
python-version: '3.13'
28+
architecture: 'x64'
2929
- name: Setup virtual env
3030
run: |
3131
python -m venv ./venv
32-
- name: Install dependencies
32+
- name: Build exe for POSIX
33+
if: runner.os != 'Windows'
3334
run: |
3435
./venv/bin/python -m pip install --upgrade pip
3536
./venv/bin/python -m pip install -r requirements_dev.txt
3637
./venv/bin/python -m pip install .
3738
./venv/bin/python -m pip install pyinstaller
39+
fidodir=$(./venv/bin/python -c "import fido2;from os import path as op;print(op.dirname(fido2.__file__))")
40+
omddir=$(./venv/bin/python -c "import orderedmultidict;from os import path as op;print(op.dirname(orderedmultidict.__file__))")
41+
./venv/bin/python -m PyInstaller -F --hidden-import=gimme_aws_creds --add-data "$fidodir/public_suffix_list.dat:fido2" --add-data "$omddir/__version__.py:orderedmultidict" bin/gimme-aws-creds
42+
- name: Upload POSIX executable
43+
if: runner.os != 'Windows'
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: gimme-aws-creds-${{ matrix.os }}-x64
47+
path: dist/gimme-aws-creds
48+
- name: Build exe for Windows
49+
if: runner.os == 'Windows'
50+
shell: pwsh
51+
run: |
52+
./venv/Scripts/python -m pip install --upgrade pip
53+
./venv/Scripts/python -m pip install -r requirements_dev.txt
54+
./venv/Scripts/python -m pip install .
55+
./venv/Scripts/python -m pip install pyinstaller
56+
$fidodir = ./venv/Scripts/python -c "import fido2;from os import path as op;print(op.dirname(fido2.__file__))"
57+
$omddir = ./venv/Scripts/python -c "import orderedmultidict;from os import path as op;print(op.dirname(orderedmultidict.__file__))"
58+
./venv/Scripts/python -m PyInstaller -F --hidden-import=gimme_aws_creds --add-data "$fidodir/public_suffix_list.dat;fido2" --add-data "$omddir/__version__.py;orderedmultidict" bin/gimme-aws-creds
59+
- name: Upload Windows executable
60+
if: runner.os == 'Windows'
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: gimme-aws-creds-windows-x64
64+
path: dist/gimme-aws-creds.exe
65+
66+
build-arm:
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
os: [ubuntu-24.04-arm, macos-latest, windows-11-arm]
71+
runs-on: ${{ matrix.os }}
72+
name: Build on ${{ matrix.os }}
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v4
76+
- name: Set up Python
77+
uses: actions/setup-python@v5
78+
with:
79+
python-version: '3.13'
80+
architecture: 'arm64'
81+
- name: Setup virtual env
82+
run: |
83+
python -m venv ./venv
3884
- name: Build exe for POSIX
3985
if: runner.os != 'Windows'
4086
run: |
87+
./venv/bin/python -m pip install --upgrade pip
88+
./venv/bin/python -m pip install -r requirements_dev.txt
89+
./venv/bin/python -m pip install .
90+
./venv/bin/python -m pip install pyinstaller
4191
fidodir=$(./venv/bin/python -c "import fido2;from os import path as op;print(op.dirname(fido2.__file__))")
4292
omddir=$(./venv/bin/python -c "import orderedmultidict;from os import path as op;print(op.dirname(orderedmultidict.__file__))")
4393
./venv/bin/python -m PyInstaller -F --hidden-import=gimme_aws_creds --add-data "$fidodir/public_suffix_list.dat:fido2" --add-data "$omddir/__version__.py:orderedmultidict" bin/gimme-aws-creds
4494
- name: Upload POSIX executable
4595
if: runner.os != 'Windows'
4696
uses: actions/upload-artifact@v4
4797
with:
48-
name: gimme-aws-creds-${{ matrix.os }}-${{ matrix.arch }}
98+
name: gimme-aws-creds-${{ matrix.os }}-arm64
4999
path: dist/gimme-aws-creds
50100
- name: Build exe for Windows
51101
if: runner.os == 'Windows'
102+
shell: pwsh
103+
env:
104+
VCPKG_ROOT: 'C:\vcpkg'
105+
OPENSSL_DIR: 'C:\vcpkg\installed\arm64-windows-static'
52106
run: |
107+
vcpkg install openssl:arm64-windows-static
108+
vcpkg integrate install
109+
./venv/Scripts/python -m pip install --upgrade pip
110+
./venv/Scripts/python -m pip install --only-binary=:all: -r requirements_dev.txt
111+
./venv/Scripts/python -m pip install .
112+
./venv/Scripts/python -m pip install pyinstaller
53113
$fidodir = ./venv/Scripts/python -c "import fido2;from os import path as op;print(op.dirname(fido2.__file__))"
54114
$omddir = ./venv/Scripts/python -c "import orderedmultidict;from os import path as op;print(op.dirname(orderedmultidict.__file__))"
55115
./venv/Scripts/python -m PyInstaller -F --hidden-import=gimme_aws_creds --add-data "$fidodir/public_suffix_list.dat;fido2" --add-data "$omddir/__version__.py;orderedmultidict" bin/gimme-aws-creds
56116
- name: Upload Windows executable
57117
if: runner.os == 'Windows'
58118
uses: actions/upload-artifact@v4
59119
with:
60-
name: gimme-aws-creds-windows-${{ matrix.arch }}
120+
name: gimme-aws-creds-windows-arm64
61121
path: dist/gimme-aws-creds.exe
62-

.github/workflows/build_nix.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/cicd.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@ on:
77
branches: [ '*' ]
88
release:
99
types: [ created ]
10+
workflow_dispatch:
1011

1112
jobs:
1213
test:
1314
name: Unit Tests
1415
runs-on: ubuntu-latest
1516
strategy:
1617
matrix:
17-
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
18+
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
1819

1920
steps:
20-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2122
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
2324
with:
2425
python-version: ${{ matrix.python-version }}
2526
- name: Install dependencies
@@ -43,11 +44,11 @@ jobs:
4344

4445
steps:
4546
- name: Checkout repository
46-
uses: actions/checkout@v3
47+
uses: actions/checkout@v4
4748

4849
# Initializes the CodeQL tools for scanning.
4950
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@v2
51+
uses: github/codeql-action/init@v3
5152
with:
5253
languages: ${{ matrix.language }}
5354
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +59,7 @@ jobs:
5859
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5960
# If this step fails, then you should remove it and run the build manually (see below)
6061
- name: Autobuild
61-
uses: github/codeql-action/autobuild@v2
62+
uses: github/codeql-action/autobuild@v3
6263

6364
# ℹ️ Command-line programs to run using the OS shell.
6465
# 📚 https://git.io/JvXDl
@@ -72,29 +73,29 @@ jobs:
7273
# make release
7374

7475
- name: Perform CodeQL Analysis
75-
uses: github/codeql-action/analyze@v2
76+
uses: github/codeql-action/analyze@v3
7677

7778
deploy:
79+
if: github.repository == 'Nike-Inc/gimme-aws-creds' && github.event_name == 'release'
7880
name: Deploy to PyPi
7981
runs-on: ubuntu-latest
8082
needs:
8183
- test
8284
- code-scan
83-
if: github.event_name == 'release'
8485
steps:
85-
- uses: actions/checkout@v3
86+
- uses: actions/checkout@v4
8687
- name: Set up Python
87-
uses: actions/setup-python@v3
88+
uses: actions/setup-python@v5
8889
with:
8990
python-version: '3.x'
9091
- name: Install dependencies
9192
run: |
9293
python -m pip install --upgrade pip
93-
pip install setuptools wheel twine
94+
pip install setuptools wheel twine build
9495
- name: Build and publish
9596
env:
9697
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
9798
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
9899
run: |
99-
python setup.py sdist bdist_wheel
100+
python -m build
100101
twine upload dist/*

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
description: Create a GitHub release and attach built binaries when a version tag is pushed
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
jobs:
10+
release:
11+
if: github.repository == 'warnermedia/gimme-aws-creds'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: get id of run with latest binaries
15+
id: get_run_id
16+
run: |
17+
run_id=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
18+
"https://api.github.com/repos/${OWNER}/${REPO_NAME}/actions/workflows/binaries.yml/runs?status=success" | \
19+
jq -r '.workflow_runs|sort_by(.updated_at)[-1].id')
20+
printf 'run_id=%s\n' "$run_id" >>"$GITHUB_OUTPUT"
21+
- name: Download all workflow run artifacts
22+
uses: actions/download-artifact@v4
23+
with:
24+
path: ./artifacts
25+
run-id: ${{ steps.get_run_id.outputs.run_id }}
26+
- name: Create Release
27+
uses: softprops/action-gh-release@v2
28+
with:
29+
files: ./artifacts/**/*
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ RUN apk --update add libgcc
99
ENV PACKAGES="gcc musl-dev python3-dev libffi-dev openssl-dev cargo"
1010

1111
RUN apk --update add $PACKAGES \
12-
&& pip install --upgrade pip setuptools-rust \
13-
&& python setup.py install \
12+
&& pip install --upgrade pip setuptools-rust build -r requirements.txt \
13+
&& pip install . \
1414
&& apk del --purge $PACKAGES
1515

1616
ENTRYPOINT ["/usr/local/bin/gimme-aws-creds"]

Makefile

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
1-
ifdef OS
2-
BIN := Scripts
3-
PYTHON := python
4-
SEP := ;
5-
RM := rd /s /q
6-
else
7-
BIN := bin
8-
PYTHON := python3
9-
SEP := :
10-
RM := rm -rf
11-
endif
1+
init:
2+
pip3 install -r requirements_dev.txt
123

13-
docker-build: clean
4+
docker-build:
145
docker build -t gimme-aws-creds .
156

16-
test: docker-build
17-
pytest -vv tests
18-
19-
venv:
20-
$(PYTHON) -mvenv ./venv
21-
22-
init: venv
23-
./venv/$(BIN)/$(PYTHON) -mpip install -r requirements_dev.txt
24-
25-
exe: init
26-
./venv/$(BIN)/$(PYTHON) -mpip install .
27-
$(eval FIDODIR := $(shell ./venv/$(BIN)/$(PYTHON) -c "import fido2;from os import path as op;print(op.dirname(fido2.__file__))"))
28-
./venv/$(BIN)/$(PYTHON) -mPyInstaller -F --hidden-import=gimme_aws_creds --add-data "$(FIDODIR)/public_suffix_list.dat$(SEP)fido2" bin/gimme-aws-creds
29-
30-
clean:
31-
$(RM) build dist venv
7+
test:
8+
python -m pip install --upgrade pip -r requirements_dev.txt
9+
python -m pytest -vv tests

0 commit comments

Comments
 (0)