-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from JSchmie/develop
Update main to release version 0.3.0
- Loading branch information
Showing
18 changed files
with
245 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# GitHub recommends pinning actions to a commit SHA. | ||
# To get a newer version, you will need to update the SHA. | ||
# You can also reference a tag or branch, but the action may change without warning. | ||
|
||
name: Publish Docker image | ||
|
||
on: | ||
|
||
push: | ||
tags: | ||
- v* | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
image: hadr0n/scraibe | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
security-events: write | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-tags: true | ||
fetch-depth: 0 | ||
|
||
- name: Get Version Tag | ||
id: version | ||
run: | | ||
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT | ||
- name: Overwrite label tag | ||
run: sed -i 's/LABEL version=".*"/LABEL version="'${{ steps.version.outputs.tag }}'"/' Dockerfile | ||
|
||
- name: Test name and tag | ||
run: | | ||
echo "${{ env.image }}:latest,${{ env.image }}:${{ steps.version.outputs.tag }}" | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
id: push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: "${{ env.image }}:latest,${{ env.image }}:${{ steps.version.outputs.tag }}" | ||
|
||
- name: SBOM Generation | ||
uses: anchore/sbom-action@v0 | ||
with: | ||
image: ${{ env.image }}:latest | ||
|
||
- name: Scan image | ||
id: scan | ||
uses: anchore/scan-action@v3 | ||
with: | ||
image: ${{ env.image }}:latest | ||
fail-build: false | ||
|
||
- name: upload Anchore scan SARIF report | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.scan.outputs.sarif }} | ||
|
||
# - name: Inspect action SARIF report | ||
# run: cat ${{ steps.scan.outputs.sarif }} | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: SARIF report | ||
path: ${{ steps.scan.outputs.sarif }} | ||
|
||
# - name: Generate artifact attestation | ||
# uses: actions/attest-build-provenance@v1 | ||
# with: | ||
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
# subject-digest: ${{ steps.push.outputs.digest }} | ||
# push-to-registry: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- develop | ||
types: | ||
- closed | ||
paths: | ||
- scraibe/** | ||
- pyproject.toml | ||
|
||
push: | ||
tags: | ||
- 'v*.*.*' | ||
branches: | ||
- "develop" | ||
paths: | ||
- "scraibe/**" | ||
- "pyproject.toml" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
|
@@ -27,13 +23,7 @@ on: | |
|
||
jobs: | ||
Build-and-publish-to-Test-PyPI: | ||
if: | | ||
(github.event_name == 'workflow_dispatch' && | ||
github.event.inputs.test == 'true') || | ||
(github.event_name == 'pull_request_target' && | ||
github.event.pull_request.merged && | ||
contains(github.event.pull_request.labels.*.name, 'release')) || | ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) | ||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.test == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -72,28 +62,16 @@ jobs: | |
needs: Test-PyPi-install | ||
runs-on: ubuntu-latest | ||
if: | | ||
always() && | ||
(( needs.Build-and-publish-to-Test-PyPI.result != 'failure' && | ||
needs.Test-PyPi-install.result != 'failure' ) && | ||
((github.event_name == 'workflow_dispatch' && | ||
github.event.inputs.publish_to_pypi == 'true') || | ||
(github.event_name == 'pull_request_target' && | ||
github.event.pull_request.merged && | ||
contains(github.event.pull_request.labels.*.name, 'release')) || | ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')))) | ||
always() && | ||
(( needs.Build-and-publish-to-Test-PyPI.result != 'failure' && | ||
needs.Test-PyPi-install.result != 'failure' ) || | ||
((github.event_name == 'workflow_dispatch' && | ||
github.event.inputs.publish_to_pypi == 'true'))) | ||
steps: | ||
- name: Checkout Repository Tags | ||
uses: actions/checkout@v4 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
fetch-depth: '0' | ||
branch: 'main' | ||
- name: Checkout Repository (Develop) | ||
uses: actions/checkout@v4 | ||
if: github.ref == 'refs/heads/develop' | ||
with: | ||
fetch-depth: '0' | ||
branch: 'develop' | ||
- name: Set up Poetry 📦 | ||
uses: JRubics/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.