Skip to content

Commit 9824fe3

Browse files
authored
Create initial action for sigstore-python (#1)
* Create initial action for `sigstore-python` * Remove stray outputs tag * Fix README example * Remove unused import * Explicitly pin `cryptography` in requirements file * Give workflow permission to use OIDC token * Add remaining `sigstore-python` flags * Document remaining settings in README * Add staging self-test * Trigger CI again * Verify signatures in selftest * Fix invocation * Turn on debug logging * Add debug setting to `action.yml` * Fix boolean defaults * Revert "Turn on debug logging" This reverts commit 3f00a86. * Give more human friendly names to the sign and verify steps
1 parent 4bbe7fe commit 9824fe3

File tree

11 files changed

+641
-25
lines changed

11 files changed

+641
-25
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.7"
17+
- name: lint
18+
run: make lint

.github/workflows/selftest.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Self-test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
id-token: write
12+
13+
jobs:
14+
selftest:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Sign artifact and publish signature
19+
uses: ./
20+
id: sigstore-python
21+
with:
22+
inputs: ./test/artifact.txt
23+
- name: Verify artifact signature
24+
run: |
25+
sigstore verify --certificate ./test/artifact.txt.crt --signature ./test/artifact.txt.sig ./test/artifact.txt
26+
27+
selftest-staging:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
- name: Sign artifact and publish signature
32+
uses: ./
33+
id: sigstore-python
34+
with:
35+
inputs: ./test/artifact.txt
36+
staging: true
37+
- name: Verify artifact signature
38+
run: |
39+
sigstore verify --certificate ./test/artifact.txt.crt --signature ./test/artifact.txt.sig --staging ./test/artifact.txt

LICENSE

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
Apache License
23
Version 2.0, January 2004
34
http://www.apache.org/licenses/
@@ -174,28 +175,3 @@
174175
of your accepting any such warranty or additional liability.
175176

176177
END OF TERMS AND CONDITIONS
177-
178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright [yyyy] [name of copyright owner]
190-
191-
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
193-
You may obtain a copy of the License at
194-
195-
http://www.apache.org/licenses/LICENSE-2.0
196-
197-
Unless required by applicable law or agreed to in writing, software
198-
distributed under the License is distributed on an "AS IS" BASIS,
199-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200-
See the License for the specific language governing permissions and
201-
limitations under the License.

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.PHONY: all
2+
all:
3+
@echo "Run my targets individually!"
4+
5+
env/pyvenv.cfg: dev-requirements.txt
6+
python3 -m venv env
7+
./env/bin/python -m pip install --upgrade pip
8+
./env/bin/python -m pip install --requirement dev-requirements.txt
9+
10+
.PHONY: dev
11+
dev: env/pyvenv.cfg
12+
13+
.PHONY: lint
14+
lint: env/pyvenv.cfg action.py
15+
./env/bin/python -m black action.py
16+
./env/bin/python -m isort action.py
17+
./env/bin/python -m flake8 --max-line-length 100 action.py

0 commit comments

Comments
 (0)