Skip to content

Commit

Permalink
Add rough workflow files (squash)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwparent committed Dec 12, 2023
1 parent cc97643 commit 37bcc88
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: workflow_dispatch


jobs:
build-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfiles/file/Dockerfile.file
load: true
18 changes: 18 additions & 0 deletions .github/workflows/build-gpg4win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: workflow_dispatch


jobs:
build-gpg4win:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfiles/gpg4win/Dockerfile.gpg4win
load: true
18 changes: 18 additions & 0 deletions .github/workflows/build-mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: workflow_dispatch


jobs:
build-mingw-w64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfiles/mingw-w64/Dockerfile.mingw-w64
load: true
48 changes: 48 additions & 0 deletions .github/workflows/test-resources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Test Build Resources"

on:
pull_request:
branches:
- main

concurrency:
group: ci-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true

jobs:
changed:
name: "Build and Upload Resources"
runs-on: ubuntu-latest
outputs:
mingw: ${{ steps.changes.outputs.mingw }}
file: ${{ steps.changes.outputs.file }}
gpg4win: ${{ steps.changes.outputs.gpg4win }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
mingw:
- 'Dockerfiles/mingw-w64/**'
file:
- 'Dockerfiles/file/**'
gpg4win:
- 'Dockerfiles/gpg4win/**'
build-mingw:
name: "Mingw-w64 build"
if: ${{ needs.changed.outputs.mingw }}
needs: [changed]
uses: ./.github/worflows/build-mingw.yml

build-gpg:
name: "Gpg x-build for Windows"
if: ${{ !failure() && !cancelled() && needs.changed.outputs.gpg4win }}
needs: [build-mingw]
uses: ./.github/worflows/build-gpg.yml

build-file:
name: "File x-build for Windows"
if: ${{ !failure() && !cancelled() && needs.changed.outputs.file }}
needs: [build-mingw]
uses: ./.github/worflows/build-file.yml
66 changes: 66 additions & 0 deletions .github/workflows/update-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on: workflow_dispatch

env:
REGISTRY: ghcr.io
IMAGE_NAME: file

jobs:
build-file:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/windows-resource/${{ env.IMAGE_NAME }}
tags: |
type=edge,enable=true,branch=main
flavor: |
latest=true
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push-file:
runs-on: ubuntu-latest
needs: [build-file]
steps:
- uses: actions/checkout@v4
with:
fetch_depth: 0
- name: Extract file binary tree + archive
run: |
mkdir -p binary/bootstrap/file
docker cp $(docker create ${{ env.REGISTRY }}/${{ github.repository_owner }}/windows-resource/${{ env.IMAGE_NAME }}:latest):/opt/file binary/bootstrap/file
cd binary/bootstrap
tar -cz file > file.tar.gz
cp file.tar.gz ../../file.tar.gz
- name: Checkout pages
run: |
git fetch --all
git checkout -f -B pages --track origin/pages
- name: Push file archives to pages
run: |
cd pages
git config --local user.email "[email protected]"
git config --local user.name "Github Actions from commit ${{ github.sha }}"
git add
34 changes: 34 additions & 0 deletions .github/workflows/update-gpg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on: workflow_dispatch

env:
REGISTRY: ghcr.io
IMAGE_NAME: gpg4win

jobs:
build-mingw:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/windows-resource/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
35 changes: 35 additions & 0 deletions .github/workflows/update-mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on: workflow_dispatch

env:
REGISTRY: ghcr.io
IMAGE_NAME: mingw-w64

jobs:
build-mingw:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/windows-resource/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

46 changes: 46 additions & 0 deletions .github/workflows/update-resources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Update resources"

on:
push:
branches:
- main

concurrency:
group: ci-${{github.ref}}-${{ github.run_number }}
cancel-in-progress: true

jobs:
changed:
name: "Build and Upload Resources"
runs-on: ubuntu-latest
outputs:
mingw: ${{ steps.changes.outputs.mingw }}
file: ${{ steps.changes.outputs.file }}
gpg4win: ${{ steps.changes.outputs.gpg4win }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
mingw:
- 'Dockerfiles/mingw-w64/**'
file:
- 'Dockerfiles/file/**'
gpg4win:
- 'Dockerfiles/gpg4win/**'
build-upload-mingw:
name: "Mingw-w64 build and Upload"
if: ${{ needs.changed.outputs.mingw }}
needs: [changed]
uses: ./.github/worflows/update-mingw.yml
build-upload-gpg:
name: "Gpg x-build and upload for Windows"
if: ${{ !failure() && !cancelled() && needs.changed.outputs.gpg4win }}
needs: [build-upload-mingw]
uses: ./.github/worflows/update-gpg.yml
build-upload-file:
name: "File x-build and upload for Windows"
if: ${{ !failure() && !cancelled() && needs.changed.outputs.file }}
needs: [build-upload-mingw]
uses: ./.github/worflows/update-file.yml

0 comments on commit 37bcc88

Please sign in to comment.