Bump pack to v0.32.0 #146
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create or Update Draft Release | |
on: | |
push: | |
branches: | |
- main | |
- v* | |
repository_dispatch: | |
types: [ version-bump ] | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version of the release to cut (e.g. 1.2.3)' | |
required: false | |
concurrency: release | |
jobs: | |
unit: | |
name: Unit Tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 'stable' | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Docker Multi-Platform Builds | |
run: | | |
docker run --privileged --rm docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 | |
- name: Run Unit Tests | |
run: ./scripts/unit.sh | |
release: | |
name: Release | |
runs-on: ubuntu-22.04 | |
needs: unit | |
steps: | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 'stable' | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true | |
- name: Reset Draft Release | |
id: reset | |
uses: paketo-buildpacks/github-config/actions/release/reset-draft@main | |
with: | |
repo: ${{ github.repository }} | |
token: ${{ github.token }} | |
- name: Calculate Semver Tag | |
if: github.event.inputs.version == '' | |
id: semver | |
uses: paketo-buildpacks/github-config/actions/tag/calculate-semver@main | |
with: | |
repo: ${{ github.repository }} | |
token: ${{ github.token }} | |
ref-name: ${{ github.ref_name }} | |
- name: Set Release Tag | |
id: tag | |
run: | | |
tag="${{ github.event.inputs.version }}" | |
if [ -z "${tag}" ]; then | |
tag="${{ steps.semver.outputs.tag }}" | |
fi | |
echo "tag=${tag}" >> "$GITHUB_OUTPUT" | |
- name: Package Jam | |
run: ./scripts/package.sh --version ${{ steps.tag.outputs.tag }} | |
- name: Create Release | |
uses: paketo-buildpacks/github-config/actions/release/create@main | |
with: | |
repo: ${{ github.repository }} | |
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} | |
tag_name: v${{ steps.tag.outputs.tag }} | |
target_commitish: ${{ github.sha }} | |
name: v${{ steps.tag.outputs.tag }} | |
draft: true | |
assets: | | |
[ | |
{ | |
"path": "build/jam-darwin", | |
"name": "jam-darwin", | |
"content_type": "application/octet-stream" | |
}, | |
{ | |
"path": "build/jam-darwin", | |
"name": "jam-darwin-amd64", | |
"content_type": "application/octet-stream" | |
}, | |
{ | |
"path": "build/jam-darwin-arm64", | |
"name": "jam-darwin-arm64", | |
"content_type": "application/octet-stream" | |
}, | |
{ | |
"path": "build/jam-linux", | |
"name": "jam-linux", | |
"content_type": "application/octet-stream" | |
}, | |
{ | |
"path": "build/jam-linux", | |
"name": "jam-linux-amd64", | |
"content_type": "application/octet-stream" | |
}, | |
{ | |
"path": "build/jam-linux-arm64", | |
"name": "jam-linux-arm64", | |
"content_type": "application/octet-stream" | |
}, | |
{ | |
"path": "build/jam-windows.exe", | |
"name": "jam-windows.exe", | |
"content_type": "application/octet-stream" | |
}, | |
{ | |
"path": "build/jam-windows.exe", | |
"name": "jam-windows-amd64.exe", | |
"content_type": "application/octet-stream" | |
}, | |
{ | |
"path": "build/jam-windows-arm64.exe", | |
"name": "jam-windows-arm64.exe", | |
"content_type": "application/octet-stream" | |
} | |
] | |
failure: | |
name: Alert on Failure | |
runs-on: ubuntu-22.04 | |
needs: [ unit, release ] | |
if: ${{ always() && needs.unit.result == 'failure' || needs.release.result == 'failure' }} | |
steps: | |
- name: File Failure Alert Issue | |
uses: paketo-buildpacks/github-config/actions/issue/file@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repo: ${{ github.repository }} | |
label: "failure:release" | |
comment_if_exists: true | |
issue_title: "Failure: Create Draft Release workflow" | |
issue_body: | | |
Create Draft Release workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). | |
comment_body: | | |
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |