Skip to content

2.0.0-20

2.0.0-20 #25

Workflow file for this run

name: Release
on:
release:
types:
- published
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
register:
name: Package, Publish, and Register
runs-on:
- ubuntu-latest
steps:
- id: checkout
uses: actions/checkout@v2
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: setup-pack
uses: buildpacks/github-actions/[email protected]
- id: package
run: |
#!/usr/bin/env bash
set -euo pipefail
BP_ID="$(cat buildpack.toml | yj -t | jq -r .buildpack.id)"
VERSION="$(cat buildpack.toml | yj -t | jq -r .buildpack.version)"
PACKAGE="${REPO}/$(echo "$BP_ID" | sed 's/\//_/g')"
pack buildpack package --publish ${PACKAGE}:${VERSION}
DIGEST="$(crane digest ${PACKAGE}:${VERSION})"
echo "::set-output name=bp_id::$BP_ID"
echo "::set-output name=version::$VERSION"
echo "::set-output name=address::${PACKAGE}@${DIGEST}"
shell: bash
env:
REPO: ghcr.io/${{ github.repository }}
- id: register
uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:4.4.0
with:
token: ${{ secrets.PUBLIC_REPO_TOKEN }}
id: ${{ steps.package.outputs.bp_id }}
version: ${{ steps.package.outputs.version }}
address: ${{ steps.package.outputs.address }}