-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.71 KB
/
package-and-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Package and Publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
publish:
name: Package and Publish
runs-on:
- ubuntu-latest
permissions:
contents: read
packages: write
steps:
- id: checkout
uses: actions/checkout@v4
- id: setup-tools
uses: buildpacks/github-actions/[email protected]
- id: setup-pack
uses: buildpacks/github-actions/[email protected]
- id: login-docker
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- id: package-buildpack
run: |
#!/usr/bin/env bash
set -euo pipefail
cd buildpacks
ORG="ghcr.io/${GITHUB_REPOSITORY_OWNER}"
BP_ID="$(cat test-info/buildpack.toml | yj -t | jq -r .buildpack.id)"
REPO="$(echo "$BP_ID" | sed 's/.*\///')"
VERSION="$(cat test-info/buildpack.toml | yj -t | jq -r .buildpack.version)"
PACKAGE="${ORG}/${REPO}"
pack buildpack package ${PACKAGE}:${VERSION} --config package.toml --target "linux/amd64" --target "linux/arm64 --publish
cd ..
shell: bash
- id: package-builder
run: |
#!/usr/bin/env bash
set -euo pipefail
cd builder
ORG="ghcr.io/${GITHUB_REPOSITORY_OWNER}"
REPO=$(echo "${{ github.repository }}" | sed 's/^.*\///')
TAG="${{ github.ref_name }}"
VERSION="${TAG#v}"
PACKAGE="${ORG}/${REPO}"
pack builder create "${PACKAGE}:${VERSION}" --config builder.toml --target "linux/amd64" --target "linux/arm64 --publish
cd ..
shell: bash