This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
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 crazy-max/split-workflow
ci: split build and release workflows
- Loading branch information
Showing
3 changed files
with
93 additions
and
39 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
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,81 @@ | ||
name: release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Buildx version (e.g. v0.8.1)' | ||
required: true | ||
dry-run: | ||
description: 'Dry run' | ||
required: true | ||
type: boolean | ||
|
||
env: | ||
#REPO_SLUG: "docker/buildx-pkg" # FIXME: uncomment when moved to docker org and don't forget to update secrets | ||
REPO_SLUG: "crazymax/buildx-packaging" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Set Buildx version | ||
run: | | ||
echo "BUILDX_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | ||
- | ||
name: Dump context | ||
uses: crazy-max/ghaction-dump-context@v1 | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
${{ env.REPO_SLUG }} | ||
tags: | | ||
type=raw,value=${{ env.BUILDX_VERSION }} | ||
type=raw,value=${{ env.BUILDX_VERSION }}-${{ github.run_number }} | ||
labels: | | ||
github.buildx-packaging.run_id=${{ github.run_id }} | ||
github.buildx-packaging.run_number=${{ github.run_number }} | ||
bake-target: meta-helper | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
if: github.event.inputs.dry-run != 'true' | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build | ||
uses: docker/bake-action@v1 | ||
with: | ||
files: | | ||
./docker-bake.hcl | ||
${{ steps.meta.outputs.bake-file }} | ||
targets: pkg-cross | ||
set: | | ||
*.output=type=image,push=${{ github.event.inputs.dry-run != 'true' }} | ||
- | ||
name: Create Release | ||
uses: softprops/action-gh-release@9729932bfb75c05ad1f6e3a729294e05abaa7001 | ||
if: github.event.inputs.dry-run != 'true' | ||
with: | ||
name: ${{ env.BUILDX_VERSION }}-${{ github.run_number }} | ||
tag_name: ${{ env.BUILDX_VERSION }}-${{ github.run_number }} | ||
target_commitish: ${{ github.sha }} | ||
body: | | ||
* Tags pushed: [`${{ env.REPO_SLUG }}:${{ env.BUILDX_VERSION }}`, `${{ env.REPO_SLUG }}:${{ env.BUILDX_VERSION }}-${{ github.run_number }}`](https://hub.docker.com/r/${{ env.REPO_SLUG }}) | ||
* Buildx release: https://github.com/docker/buildx/releases/tag/${{ env.BUILDX_VERSION }} | ||
env: | ||
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