Merge branch 'main' into main
This commit is contained in:
@@ -2,7 +2,7 @@ name: Mark stale issues and pull requests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "21 4 * * *"
|
- cron: $cron-daily
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: Mark stale issues and pull requests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "30 1 * * *"
|
- cron: $cron-daily
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
|
|||||||
+44
-61
@@ -1,80 +1,63 @@
|
|||||||
name: Docker
|
name: Docker
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: $cron-daily
|
||||||
push:
|
push:
|
||||||
# Publish `$default-branch` as Docker `latest` image.
|
branches: [ $default-branch ]
|
||||||
branches:
|
# Publish semver tags as releases.
|
||||||
- $default-branch
|
tags: [ 'v*.*.*' ]
|
||||||
|
|
||||||
# Publish `v1.2.3` tags as releases.
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
|
|
||||||
# Run tests for any PRs.
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# TODO: Change variable to your image's name.
|
# Use docker.io for Docker Hub if empty
|
||||||
IMAGE_NAME: image
|
REGISTRY: ghcr.io
|
||||||
|
# github.repository as <account>/<repo>
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Run tests.
|
build:
|
||||||
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
if [ -f docker-compose.test.yml ]; then
|
|
||||||
docker-compose --file docker-compose.test.yml build
|
|
||||||
docker-compose --file docker-compose.test.yml run sut
|
|
||||||
else
|
|
||||||
docker build . --file Dockerfile
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Push image to GitHub Packages.
|
|
||||||
# See also https://docs.docker.com/docker-hub/builds/
|
|
||||||
push:
|
|
||||||
# Ensure test job passes before pushing image.
|
|
||||||
needs: test
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push'
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Build image
|
# Login against a Docker registry except on PR
|
||||||
run: docker build . --file Dockerfile --tag $IMAGE_NAME
|
# https://github.com/docker/login-action
|
||||||
|
- name: Log into registry ${{ env.REGISTRY }}
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Log into registry
|
# Extract metadata (tags, labels) for Docker
|
||||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
# https://github.com/docker/metadata-action
|
||||||
|
- name: Extract Docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
- name: Push image
|
# Build and push Docker image with Buildx (don't push on PR)
|
||||||
run: |
|
# https://github.com/docker/build-push-action
|
||||||
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||||
# Change all uppercase to lowercase
|
with:
|
||||||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
context: .
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
# Strip git ref prefix from version
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
# Strip "v" prefix from tag name
|
|
||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
|
||||||
|
|
||||||
# Use Docker `latest` tag convention
|
|
||||||
[ "$VERSION" == "$default-branch" ] && VERSION=latest
|
|
||||||
|
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
|
||||||
echo VERSION=$VERSION
|
|
||||||
|
|
||||||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
|
|
||||||
docker push $IMAGE_ID:$VERSION
|
|
||||||
|
|||||||
+2
-1
@@ -144,7 +144,8 @@ jobs:
|
|||||||
|
|
||||||
# oc-login works on all platforms, but oc must be installed first.
|
# oc-login works on all platforms, but oc must be installed first.
|
||||||
# The GitHub Ubuntu runner already includes oc.
|
# The GitHub Ubuntu runner already includes oc.
|
||||||
# Otherwise, https://github.com/redhat-actions/oc-installer#readme is available.
|
# Otherwise, https://github.com/redhat-actions/openshift-tools-installer can be used to install oc,
|
||||||
|
# as well as many other tools.
|
||||||
|
|
||||||
# https://github.com/redhat-actions/oc-login#readme
|
# https://github.com/redhat-actions/oc-login#readme
|
||||||
- name: Log in to OpenShift
|
- name: Log in to OpenShift
|
||||||
|
|||||||
+14
-9
@@ -1,11 +1,16 @@
|
|||||||
# This workflow will upload a Python Package using Twine when a release is created
|
# This workflow will upload a Python Package using Twine when a release is created
|
||||||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
name: Upload Python Package
|
name: Upload Python Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@@ -21,11 +26,11 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install setuptools wheel twine
|
pip install build
|
||||||
- name: Build and publish
|
- name: Build package
|
||||||
env:
|
run: python -m build
|
||||||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
- name: Publish package
|
||||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
||||||
run: |
|
with:
|
||||||
python setup.py sdist bdist_wheel
|
user: __token__
|
||||||
twine upload dist/*
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user