This commit is contained in:
Mark Joshwel 2023-06-16 05:38:58 +00:00
parent 8ad086f468
commit 4fdb6b9fc8
2 changed files with 7 additions and 54 deletions

View file

@ -1,52 +0,0 @@
name: release (slsa 3)
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: install devbox
uses: jetpack-io/devbox-install-action@v0.3.0
- name: install dependencies
run: devbox run poetry install
- name: install dependencies
id: build
run: devbox run poetry build
- name: generate provenance subjects
id: hash
run: |
cd dist
HASHES=$(sha256sum * | base64 -w0)
echo "hashes=$HASHES" >> "$GITHUB_OUTPUT"
- name: release
uses: softprops/action-gh-release@v0.1.15
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/*.whl
provenance:
needs: [build]
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.6.0
with:
base64-subjects: "${{ needs.build.outputs.hashes }}"
upload-assets: true

View file

@ -30,6 +30,7 @@ For more information, please refer to <http://unlicense.org/>
""" """
from argparse import ArgumentParser from argparse import ArgumentParser
from collections import OrderedDict
from sys import stderr from sys import stderr
from typing import Any, Callable, Final, NamedTuple from typing import Any, Callable, Final, NamedTuple
@ -188,7 +189,7 @@ def surplus(
if debug: if debug:
stderr.write(f"debug: {location=}\n") stderr.write(f"debug: {location=}\n")
data: list[str] = [ text: list[str] = [
( (
",".join( ",".join(
[ [
@ -241,7 +242,11 @@ def surplus(
location["address"].get("country"), location["address"].get("country"),
] ]
return True, "\n".join([d for d in data if ((d != None) and d != "")]) unique = OrderedDict()
for line in text:
unique.update({line: None})
return True, "\n".join([d for d in unique.keys() if ((d != None) and d != "")])
def parse_query( def parse_query(