-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #3 from cdalvaro/feature/upgrade-2.2.0
Upgrade to version 2.2.0
- Loading branch information
Showing
19 changed files
with
842 additions
and
181 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
github: cdalvaro |
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,15 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
|
||
# Configuration for Dockerfile | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
# Disable all pull requests for Docker dependencies | ||
open-pull-requests-limit: 0 |
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,18 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 60 | ||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 7 | ||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
- keep-alive | ||
# Label to use when marking an issue as stale | ||
staleLabel: stale | ||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: 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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Build and test Docker image | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "./**/*.md" | ||
- "LICENSE" | ||
|
||
env: | ||
IMAGE_NAME: localhost:5000/cdalvaro/docker-nerd-fonts-patcher:${{ github.sha }} | ||
REGISTRY_PATH: ${{ github.workspace }}/registry | ||
CACHE_PATH: /tmp/.buildx-cache | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
driver-opts: network=host | ||
|
||
- name: Start Docker registry | ||
run: | | ||
docker run --rm --detach --publish 5000:5000 \ | ||
--volume ${REGISTRY_PATH}:/var/lib/registry \ | ||
--name registry registry:2 | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CACHE_PATH }} | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Build docker-nerd-fonts-patcher image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
cache-from: | | ||
type=local,src=${{ env.CACHE_PATH }} | ||
ghcr.io/cdalvaro/docker-nerd-fonts-patcher:latest | ||
cache-to: type=local,dest=${{ env.CACHE_PATH }} | ||
push: true | ||
tags: ${{ env.IMAGE_NAME }} | ||
|
||
- name: Stop Docker registry | ||
run: docker stop registry | ||
|
||
- name: Upload Docker registry data for testing | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: docker-registry-data | ||
path: ${{ env.REGISTRY_PATH }}/ | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: build | ||
strategy: | ||
matrix: | ||
platform: [linux/amd64, linux/arm64, linux/arm/v7] | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: enabled | ||
PLATFORM: ${{ matrix.platform }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download Docker registry data from build job | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: docker-registry-data | ||
path: ${{ env.REGISTRY_PATH }} | ||
|
||
- name: Enable Docker experimental | ||
run: | | ||
# Enable docker daemon experimental support. | ||
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json | ||
sudo systemctl restart docker | ||
# Install QEMU multi-architecture support for docker buildx. | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
- name: Start Docker registry | ||
run: | | ||
docker run --rm --detach --publish 5000:5000 \ | ||
--volume ${REGISTRY_PATH}:/var/lib/registry \ | ||
--name registry registry:2 | ||
sleep 10 | ||
- name: Import Docker images | ||
run: docker pull --platform ${{ matrix.platform }} ${IMAGE_NAME} | ||
|
||
- name: Docker inspect | ||
run: docker buildx imagetools inspect ${IMAGE_NAME} | grep '${{ matrix.platform }}' | ||
|
||
- name: Install ttx tool | ||
run: sudo apt update -y && sudo apt install -y python3-fonttools fonttools | ||
|
||
- name: Execute tests | ||
run: bash tests/patch-test.sh |
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,25 @@ | ||
name: Lint Code | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Super Linter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Lint code base | ||
uses: github/[email protected] | ||
env: | ||
VALIDATE_ALL_CODEBASE: false | ||
VALIDATE_DOCKERFILE_HADOLINT: true | ||
VALIDATE_BASH: true | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,123 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- './**/*.md' | ||
- 'LICENSE' | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
IMAGE_NAME: cdalvaro/docker-nerd-fonts-patcher | ||
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7 | ||
CACHE_PATH: /tmp/.buildx-docker-nerd-fonts-patcher-cache | ||
EXTRA_REGISTRIES: ghcr.io quay.io | ||
|
||
jobs: | ||
metadata: | ||
name: Metadata | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tags: ${{ steps.tags.outputs.tags }} | ||
vcs_ref: ${{ steps.vcs_ref.outputs.vcs_ref }} | ||
created_on: ${{ steps.created_on.outputs.created_on }} | ||
steps: | ||
- name: Image Tags | ||
id: tags | ||
run: | | ||
IMAGE_TAG="${{ github.event.release.tag_name }}" | ||
[ -z "${IMAGE_TAG}" ] && IMAGE_TAG='latest' | ||
DOCKER_IMAGE="${IMAGE_NAME}:${IMAGE_TAG}" | ||
TAGS="${DOCKER_IMAGE}" | ||
for registry in ${EXTRA_REGISTRIES}; do | ||
TAGS="${TAGS},${registry}/${DOCKER_IMAGE}" | ||
done | ||
echo "Image Tag: '${IMAGE_TAG}'" | ||
echo "Docker image: '${DOCKER_IMAGE}'" | ||
echo "Tags: ${TAGS}" | ||
echo ::set-output name=tags::${TAGS} | ||
- name: VCS ref | ||
id: vcs_ref | ||
run: | | ||
VCS_REF="${GITHUB_SHA::8}" | ||
echo "VCS ref: ${VCS_REF}" | ||
echo ::set-output name=vcs_ref::${VCS_REF} | ||
- name: Created On | ||
id: created_on | ||
run: | | ||
CREATED_ON="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" | ||
echo "Created on: ${CREATED_ON}" | ||
echo ::set-output name=created_on::${CREATED_ON} | ||
- name: Dump environment | ||
if: contains(toJSON(github.event.commits.*.message), 'ci(debug)') == true | ||
run: env | sort | ||
- name: Dump GitHub context | ||
if: contains(toJSON(github.event.commits.*.message), 'ci(debug)') == true | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "${GITHUB_CONTEXT}" | ||
|
||
build-publish: | ||
name: Build and publish | ||
runs-on: ubuntu-latest | ||
needs: metadata | ||
if: contains(toJSON(github.event.commits.*.message), 'ci(debug)') == false | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CACHE_PATH }} | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to Docker Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- name: Login to Quay.io Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAYIO_USERNAME }} | ||
password: ${{ secrets.QUAYIO_PASSWORD }} | ||
|
||
- name: Build and publish | ||
uses: docker/build-push-action@v3 | ||
with: | ||
platforms: ${{ env.PLATFORMS }} | ||
build-args: | | ||
VCS_REF=${{ needs.metadata.outputs.vcs_ref }} | ||
BUILD_DATE=${{ needs.metadata.outputs.created_on }} | ||
cache-from: type=local,src=${{ env.CACHE_PATH }} | ||
cache-to: type=local,dest=${{ env.CACHE_PATH }} | ||
push: true | ||
tags: ${{ needs.metadata.outputs.tags }} |
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,3 +1,4 @@ | ||
# Default directories | ||
in/ | ||
out/ | ||
tests/assets/ |
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.