From 4d003e87b0a624d46b1ca04c49262da1e64c2330 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Mon, 18 Oct 2021 14:19:59 -0400 Subject: [PATCH] Push released images to ghcr.io --- .github/workflows/release.yaml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 82bab2d77..e520b9552 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,11 +14,22 @@ jobs: release: if: ${{ github.repository == 'shipwright-io/build' }} runs-on: ubuntu-latest + env: + IMAGE_HOST: ghcr.io + IMAGE_NAMESPACE: ${{ github.repository }} + TAG: ${{ github.event.inputs.release }} + steps: - - name: Checkout code - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all history, needed for release note generation. + - uses: actions/setup-go@v2 with: - fetch-depth: 0 + go-version: 1.16.x + + # Install tools + - uses: imjasonh/setup-ko@20b7695b536c640edfafdd378d96c760460f29d6 + - name: Build Release Changelog env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -29,6 +40,7 @@ jobs: export GITHUB_TOKEN export PREVIOUS_TAG "${GITHUB_WORKSPACE}/.github/draft_release_notes.sh" + - name: Draft release id: draft_release uses: actions/create-release@v1 @@ -41,21 +53,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.16.x - - - name: Install Ko - uses: imjasonh/setup-ko@20b7695b536c640edfafdd378d96c760460f29d6 - - name: Generate and upload release.yaml env: - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} - REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} - IMAGE_HOST: quay.io - IMAGE: shipwright/shipwright-operator - TAG: ${{ github.event.inputs.release }} + REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + REGISTRY_USERNAME: ${{ github.repository_owner }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | make release