Skip to content

v0.0.2

v0.0.2 #1

Workflow file for this run

name: Release
on:
release:
types:
- published
jobs:
register:
name: Package, Publish, and Register
runs-on:
- ubuntu-latest
steps:
- id: checkout
name: Checkout code
uses: actions/checkout@v4
- if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }}
name: Login to GitHub Package Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: setup-pack
uses: buildpacks/github-actions/setup-pack@v5.5.0
- id: package
run: |
#!/usr/bin/env bash
set -euo pipefail
echo "Installing yj ${YJ_VERSION}"
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl \
--location \
--show-error \
--silent \
--output "${HOME}"/bin/yj \
"https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux"
chmod +x "${HOME}"/bin/yj
echo "Installing crane ${CRANE_VERSION}"
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl \
--show-error \
--silent \
--location \
"https://github.com/google/go-containerregistry/releases/download/v${CRANE_VERSION}/go-containerregistry_Linux_x86_64.tar.gz" \
| tar -C "${HOME}/bin" -xz crane
chmod +x "${HOME}"/bin/crane
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 "bp_id=$BP_ID" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "address=${PACKAGE}@${DIGEST}" >> "$GITHUB_OUTPUT"
shell: bash
env:
REPO: ghcr.io/${{ github.repository_owner }}/buildpacks
YJ_VERSION: 5.0.0
CRANE_VERSION: 0.8.0
- id: register
uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.5.0
with:
token: ${{ secrets.PUBLIC_REPO_TOKEN }}
id: ${{ steps.package.outputs.bp_id }}
version: ${{ steps.package.outputs.version }}
address: ${{ steps.package.outputs.address }}