diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index 8474cabe..07bd83ee 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -1,144 +1,28 @@ -name: Create or Update Draft Release +name: Skopeo check on: - push: - branches: - - main - 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 + workflow_dispatch: {} jobs: unit: name: Unit Tests runs-on: ubuntu-22.04 - outputs: - builders: ${{ steps.builders.outputs.builders }} steps: - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 'stable' - name: Checkout uses: actions/checkout@v3 - - name: Run Unit Tests - run: ./scripts/unit.sh - - name: Get builders from integration.json - id: builders + - name: Install crane run: | - source "${{ github.workspace }}/scripts/.util/builders.sh" - builders="$(util::builders::list "${{ github.workspace }}/integration.json")" - printf "Output: %s\n" "${builders}" - printf "builders=%s\n" "${builders}" >> "$GITHUB_OUTPUT" + mkdir -p "${HOME}"/bin + echo "${HOME}/bin" >> "${GITHUB_PATH}" - integration: - name: Integration Tests - runs-on: ubuntu-22.04 - needs: unit - strategy: - matrix: - builder: ${{ fromJSON(needs.unit.outputs.builders) }} - fail-fast: false # don't cancel all test jobs when one fails - steps: - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 'stable' - - name: Checkout - uses: actions/checkout@v3 - - name: Run Integration Tests - run: ./scripts/integration.sh --builder ${{ matrix.builder }} --token ${{ github.token }} - env: - TMPDIR: "${{ runner.temp }}" + VERSION=$(curl -s "https://api.github.com/repos/google/go-containerregistry/releases/latest" | jq -r '.tag_name') + OS=Linux + ARCH=x86_64 + curl -sL "https://github.com/google/go-containerregistry/releases/download/${VERSION}/go-containerregistry_${OS}_${ARCH}.tar.gz" > go-containerregistry.tar.gz - release: - name: Release - runs-on: ubuntu-22.04 - needs: integration - steps: - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 'stable' - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-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 + tar -zxvf go-containerregistry.tar.gz -C "${HOME}/bin" crane + chmod +x "${HOME}/bin/crane" + - name: crane check run: | - tag="${{ github.event.inputs.version }}" - if [ -z "${tag}" ]; then - tag="${{ steps.semver.outputs.tag }}" - fi - echo "tag=${tag}" >> "$GITHUB_OUTPUT" - - name: Package - run: ./scripts/package.sh --version "${{ steps.tag.outputs.tag }}" - - name: Create Release Notes - id: create-release-notes - uses: paketo-buildpacks/github-config/actions/release/notes@main - with: - repo: ${{ github.repository }} - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - - 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 }} - body: ${{ steps.create-release-notes.outputs.release_body }} - draft: true - assets: | - [ - { - "path": "build/buildpack.tgz", - "name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.tgz", - "content_type": "application/gzip" - }, - { - "path": "build/buildpackage.cnb", - "name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb", - "content_type": "application/gzip" - } - ] - - failure: - name: Alert on Failure - runs-on: ubuntu-22.04 - needs: [ unit, integration, release ] - if: ${{ always() && needs.unit.result == 'failure' || needs.integration.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}} + which crane + crane version diff --git a/buildpack.toml b/buildpack.toml index 8440ad5d..a8eb35e1 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -18,32 +18,6 @@ api = "0.7" [metadata.default-versions] ruby = "3.1.*" - [[metadata.dependencies]] - checksum = "sha256:0de6dcaca9e8dd1efdcf07e400eab8a7a8f19b5b5bdf206cd8da16b59f93752c" - cpe = "cpe:2.3:a:ruby-lang:ruby:3.0.5:*:*:*:*:*:*:*" - id = "ruby" - licenses = ["BSD-2-Clause", "BSD-2-Clause-NetBSD", "BSD-3-Clause", "BSD-3-Clause-No-Nuclear-License-2014", "Bison-exception-2.2", "FSFUL", "GPL-2.0-only", "GPL-2.0-or-later", "MIT", "MIT-0", "Ruby", "deprecated_GPL-2.0", "deprecated_GPL-2.0+"] - name = "Ruby" - purl = "pkg:generic/ruby@3.0.5?checksum=9afc6380a027a4fe1ae1a3e2eccb6b497b9c5ac0631c12ca56f9b7beb4848776&download_url=https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.5.tar.gz" - source = "https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.5.tar.gz" - source-checksum = "sha256:9afc6380a027a4fe1ae1a3e2eccb6b497b9c5ac0631c12ca56f9b7beb4848776" - stacks = ["io.buildpacks.stacks.bionic"] - uri = "https://artifacts.paketo.io/ruby/ruby_3.0.5_linux_x64_bionic_0de6dcac.tgz" - version = "3.0.5" - - [[metadata.dependencies]] - checksum = "sha256:f2dbef7e3cd197b81de4f1a9493c16a51ab9dc62b1bbbcd52f48ce8b18c996a6" - cpe = "cpe:2.3:a:ruby-lang:ruby:3.0.6:*:*:*:*:*:*:*" - id = "ruby" - licenses = ["BSD-2-Clause", "BSD-2-Clause-NetBSD", "BSD-3-Clause", "BSD-3-Clause-No-Nuclear-License-2014", "Bison-exception-2.2", "FSFUL", "GPL-2.0-only", "GPL-2.0-or-later", "MIT", "MIT-0", "Ruby", "deprecated_GPL-2.0", "deprecated_GPL-2.0+"] - name = "Ruby" - purl = "pkg:generic/ruby@3.0.6?checksum=6e6cbd490030d7910c0ff20edefab4294dfcd1046f0f8f47f78b597987ac683e&download_url=https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.6.tar.gz" - source = "https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.6.tar.gz" - source-checksum = "sha256:6e6cbd490030d7910c0ff20edefab4294dfcd1046f0f8f47f78b597987ac683e" - stacks = ["io.buildpacks.stacks.bionic"] - uri = "https://artifacts.paketo.io/ruby/ruby_3.0.6_linux_x64_bionic_f2dbef7e.tgz" - version = "3.0.6" - [[metadata.dependencies]] checksum = "sha256:a9c084d0785d047f9b2394cccfb16acd326654c74f201abd6d220eef386addca" cpe = "cpe:2.3:a:ruby-lang:ruby:3.1.3:*:*:*:*:*:*:*"