Release Docker image to GitHub Container Registry (#2652)
This commit is contained in:
1 parent
886a9b18b1
commit
9014c212e8
1 file changed
+41
-5
@@ -188,6 +188,7 @@ jobs:
|
|||||||
|
|
||||||
dist:
|
dist:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/jq-')
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- name: Clone repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -217,12 +218,48 @@ jobs:
|
|||||||
jq-*.tar.gz
|
jq-*.tar.gz
|
||||||
jq-*.zip
|
jq-*.zip
|
||||||
|
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
if: startsWith(github.ref, 'refs/tags/jq-')
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Docker metadata
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
id: metadata
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ github.repository }}
|
||||||
|
tags: type=match,pattern=jq-(.*),group=1,value=${{ github.ref_name }}
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Build and release Docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
provenance: false
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
|
||||||
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
|
labels: ${{ steps.metadata.outputs.labels }}
|
||||||
|
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
needs: [linux, macos, windows, dist]
|
needs: [linux, macos, windows, dist, docker]
|
||||||
if: startsWith(github.event.ref, 'refs/tags/jq-')
|
if: startsWith(github.ref, 'refs/tags/jq-')
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- name: Clone repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -240,6 +277,5 @@ jobs:
|
|||||||
cp artifacts/jq-macos-macos-13-gcc/jq release/jq-macos-amd64
|
cp artifacts/jq-macos-macos-13-gcc/jq release/jq-macos-amd64
|
||||||
cp artifacts/jq-windows-windows-2022-gcc/jq.exe release/jq-windows-amd64.exe
|
cp artifacts/jq-windows-windows-2022-gcc/jq.exe release/jq-windows-amd64.exe
|
||||||
cp artifacts/jq-dist/jq-* release/
|
cp artifacts/jq-dist/jq-* release/
|
||||||
|
gh release create "$TAG_NAME" --draft --title "jq ${TAG_NAME#jq-}" --generate-notes
|
||||||
gh release create $TAG_NAME --draft --title "jq ${TAG_NAME#jq-}" --generate-notes
|
gh release upload "$TAG_NAME" --clobber release/jq-*
|
||||||
gh release upload $TAG_NAME --clobber release/jq-*
|
|
||||||
Reference in new issue
Block a user