Skip to content

Merge pull request #3 from hostwithquantum/dependabot/github_actions/… #2

Merge pull request #3 from hostwithquantum/dependabot/github_actions/…

Merge pull request #3 from hostwithquantum/dependabot/github_actions/… #2

Workflow file for this run

---
name: release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: "r.planetary-quantum.com"
DOCKER_REPO: "buildpacks"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.BP_QUANTUM_DOCKER_USERNAME }}
password: ${{ secrets.BP_QUANTUM_DOCKER_PASSWORD }}
- uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
cp dist/build_linux_amd64_v1/build ./bin/build
cp dist/detect_linux_amd64_v1/detect ./bin/detect
- uses: buildpacks/github-actions/[email protected]
- uses: buildpacks/github-actions/[email protected]
- id: extract-version
shell: bash
run: |
TAG=${GITHUB_REF#refs/tags/}
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- id: extract-package
shell: bash
run: |
BP_ID="$(cat buildpack.toml | yj -t | jq -r .buildpack.id)"
PACKAGE="${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPO }}/$(echo "$BP_ID" | sed 's/\//_/g')"
echo "package=${PACKAGE}" >> $GITHUB_OUTPUT
- run: sed -i.bak -E "s/__replace__/${{ steps.extract-version.outputs.version }}/" buildpack.toml
- run: |
pack buildpack package \
--publish ${{ steps.extract-package.outputs.package }}:${{ steps.extract-version.outputs.version }}