Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push Container

on:
workflow_call:
inputs:
container:
description: "Container image name"
required: true
type: string

jobs:
build-and-push:
concurrency:
group: release-to-ghcr-${{ inputs.container }}
cancel-in-progress: false
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Set Calver Date
run: |
echo "builddate=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
id: version
- name: Checkout
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login To GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./${{ inputs.container }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/python/${{ inputs.container }}:${{ steps.version.outputs.builddate }}.${{ github.run_id }}
ghcr.io/python/${{ inputs.container }}:latest
61 changes: 27 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: release
on:
workflow_dispatch:
inputs:
package:
description: "Package name"
container:
description: "Container image name"
required: true
default: 'autoconf'
type: choice
Expand All @@ -13,39 +13,32 @@ on:
- devcontainer
- wasicontainer

run-name: "Release: ${{ inputs.package }}"
run-name: "Release: ${{ inputs.container }}${{ inputs.container == 'devcontainer' && ' + wasicontainer' || '' }}"

jobs:
release-to-ghcr:
concurrency:
group: release-to-ghcr-${{ inputs.package }}
cancel-in-progress: false
if: contains('["brettcannon", "corona10", "erlend-aasland"]', github.actor)
authorize:
runs-on: ubuntu-latest
if: contains('["brettcannon", "corona10", "erlend-aasland"]', github.actor)
steps:
# Checkout push-to-registry action github repository
- name: Set Calver Date
run: |
echo "builddate=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
id: version
- name: Checkout Push to Registry action
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login To GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./${{ inputs.package }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/python/${{ inputs.package }}:${{ steps.version.outputs.builddate }}.${{ github.run_id }}
ghcr.io/python/${{ inputs.package }}:latest
- run: echo "Authorized"

release-to-ghcr:
name: Release ${{ inputs.container }}
needs: authorize
uses: ./.github/workflows/build-and-push.yml
permissions:
contents: read
packages: write
with:
container: ${{ inputs.container }}

release-wasicontainer:
name: Release wasicontainer (due to devcontainer updates)
needs: [authorize, release-to-ghcr]
if: inputs.container == 'devcontainer'
uses: ./.github/workflows/build-and-push.yml
permissions:
contents: read
packages: write
with:
container: wasicontainer