Skip to content

Commit

Permalink
Merge branch 'main' into scafall1
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthaksarthak9 authored Nov 26, 2024
2 parents 3401edf + 92bc87b commit b31178b
Show file tree
Hide file tree
Showing 228 changed files with 9,556 additions and 1,634 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
go-version-file: 'go.mod'
- name: Set up go env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
Expand Down
40 changes: 28 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
config: [macos, linux, windows-lcow, windows-wcow]
include:
- config: macos
os: macos
# since macos-14 the latest runner is arm64
os: macos-arm64
runner: macos-latest
no_docker: "true"
pack_bin: pack
Expand Down Expand Up @@ -72,10 +73,10 @@ jobs:
}
shell: powershell
- name: Set up go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
go-version-file: 'go.mod'
- name: Set up go env for Unix
if: runner.os != 'Windows'
run: |
Expand Down Expand Up @@ -156,7 +157,7 @@ jobs:
env:
PACK_BUILD: ${{ github.run_number }}
shell: powershell
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: matrix.config != 'windows-lcow'
with:
name: pack-${{ matrix.os }}
Expand All @@ -170,28 +171,32 @@ jobs:
- name: linux-arm64
goarch: arm64
goos: linux
- name: macos-arm64
goarch: arm64
- name: macos
# since macos-14 default runner is arm, we need to build for intel architecture later
goarch: amd64
goos: darwin
- name: linux-s390x
goarch: s390x
goos: linux
- name: linux-ppc64le
goarch: ppc64le
goos: linux
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
go-version-file: 'go.mod'
- name: Build
run: |
[[ $GITHUB_REF =~ ^refs\/heads\/release/(.*)$ ]] && version=${BASH_REMATCH[1]} || version=0.0.0
env PACK_VERSION=${version} GOARCH=${{ matrix.goarch }} GOOS=${{ matrix.goos }} make build
env:
PACK_BUILD: ${{ github.run_number }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pack-${{ matrix.name }}
path: out/${{ env.PACK_BIN }}
Expand Down Expand Up @@ -220,7 +225,7 @@ jobs:
echo "PACK_MILESTONE=${milestone}" >> $GITHUB_ENV
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: Package artifacts - macos
run: |
chmod +x pack-macos/pack
Expand All @@ -239,6 +244,12 @@ jobs:
filename=pack-v${{ env.PACK_VERSION }}-linux-s390x.tgz
tar -C pack-linux-s390x -vzcf $filename pack
shasum -a 256 $filename > $filename.sha256
- name: Package artifacts - linux-ppc64le
run: |
chmod +x pack-linux-ppc64le/pack
filename=pack-v${{ env.PACK_VERSION }}-linux-ppc64le.tgz
tar -C pack-linux-ppc64le -vzcf $filename pack
shasum -a 256 $filename > $filename.sha256
- name: Package artifacts - macos-arm64
run: |
chmod +x pack-macos-arm64/pack
Expand Down Expand Up @@ -278,7 +289,7 @@ jobs:
milestone: ${{ env.PACK_MILESTONE }}
- name: Create Pre-Release
if: ${{ env.PACK_VERSION != env.PACK_MILESTONE }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -314,6 +325,11 @@ jobs:
```bash
(curl -sSL "https://github.com/buildpacks/pack/releases/download/v${{ env.PACK_VERSION }}/pack-v${{ env.PACK_VERSION }}-linux-s390x.tgz" | sudo tar -C /usr/local/bin/ --no-same-owner -xzv pack)
```
##### PPC64LE
```bash
(curl -sSL "https://github.com/buildpacks/pack/releases/download/v${{ env.PACK_VERSION }}/pack-v${{ env.PACK_VERSION }}-linux-ppc64le.tgz" | sudo tar -C /usr/local/bin/ --no-same-owner -xzv pack)
```
#### MacOS
Expand Down Expand Up @@ -354,7 +370,7 @@ jobs:
- name: Create Beta Release
if: ${{ env.PACK_VERSION == env.PACK_MILESTONE }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/check-latest-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Read go versions
Expand All @@ -25,7 +25,7 @@ jobs:
LATEST_GO_VERSION=$(go version | cut -d ' ' -f 3)
LATEST_RELEASE_VERSION=$(gh release list -L 1 | cut -d $'\t' -f 1 | cut -d ' ' -f 2)
LATEST_RELEASE_VERSION=$(gh release list --exclude-drafts --exclude-pre-releases -L 1 | cut -d $'\t' -f 1 | cut -d ' ' -f 2)
wget https://github.com/$GITHUB_REPOSITORY/releases/download/$LATEST_RELEASE_VERSION/pack-$LATEST_RELEASE_VERSION-linux.tgz -O out.tgz
tar xzf out.tgz
Expand Down Expand Up @@ -70,9 +70,9 @@ jobs:
fi
- name: Scan latest release image
id: scan-image
uses: anchore/scan-action@v3
uses: anchore/scan-action@v5
with:
image: buildpacksio/pack:${{ steps.read-go.outputs.latest-release-version }}
image: docker.io/buildpacksio/pack:${{ steps.read-go.outputs.latest-release-version }}
- name: Create issue if needed
if: failure() && steps.scan-image.outcome == 'failure'
env:
Expand All @@ -91,7 +91,7 @@ jobs:
search_output=$(gh issue list --search "$title" --label "$label")
GITHUB_WORKFLOW_URL=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
body="Latest buildpacksio/pack v${{ steps.read-go.outputs.latest-release-version }} triggered CVE(s) from Grype. For further details, see: $GITHUB_WORKFLOW_URL"
body="Latest docker.io/buildpacksio/pack v${{ steps.read-go.outputs.latest-release-version }} triggered CVE(s) from Grype. For further details, see: $GITHUB_WORKFLOW_URL"
if [ -z "${search_output// }" ]
then
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -45,7 +45,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -59,4 +59,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
5 changes: 3 additions & 2 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
go-version-file: 'go.mod'
- name: Set up go env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
Expand All @@ -59,3 +59,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
make acceptance
docker network prune
58 changes: 0 additions & 58 deletions .github/workflows/delivery-archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,6 @@ on:
required: true

jobs:
pack-cli:
runs-on: ubuntu-latest
env:
PACKAGE_NAME: pack-cli
steps:
- uses: actions/checkout@v4
- name: Determine version
uses: actions/github-script@v7
id: version
with:
result-encoding: string
script: |
let payload = context.payload;
let tag = (payload.release && payload.release.tag_name) || (payload.inputs && payload.inputs.tag_name);
if (!tag) {
throw "ERROR: unable to determine tag"
}
return tag.replace(/^v/, '');
- name: Set PACK_VERSION
run: echo "PACK_VERSION=${{ steps.version.outputs.result }}" >> $GITHUB_ENV
shell: bash
- name: Setup working dir
run: |
mkdir -p ${{ env.PACKAGE_NAME }}
cp .github/workflows/delivery/archlinux/${{ env.PACKAGE_NAME }}/PKGBUILD ${{ env.PACKAGE_NAME }}/PKGBUILD
- name: Metadata
id: metadata
run: |
url=https://github.com/buildpacks/pack/archive/v${{ env.PACK_VERSION }}.tar.gz
filename=pack-${{ env.PACK_VERSION }}.tgz
fullpath=`pwd`/$filename
curl -sSL "$url" -o "$fullpath"
sha512=$(sha512sum "$fullpath" | awk '{ print $1 }')
echo "url=$url" >> $GITHUB_OUTPUT
echo "sha512=$sha512" >> $GITHUB_OUTPUT
- name: Fill PKGBUILD
uses: cschleiden/replace-tokens@v1
with:
files: ${{ env.PACKAGE_NAME }}/PKGBUILD
tokenPrefix: '{{'
tokenSuffix: '}}'
env:
PACK_VERSION: ${{ env.PACK_VERSION }}
SRC_TGZ_URL: ${{ steps.metadata.outputs.url }}
SRC_TGZ_SHA: ${{ steps.metadata.outputs.sha512 }}
- name: Print PKGBUILD
run: cat ${{ env.PACKAGE_NAME }}/PKGBUILD
- name: Test
uses: docker://archlinux:latest
with:
entrypoint: .github/workflows/delivery/archlinux/test-install-package.sh
- name: Publish
uses: docker://archlinux:latest
env:
AUR_KEY: ${{ secrets.AUR_KEY }}
with:
entrypoint: .github/workflows/delivery/archlinux/publish-package.sh
pack-cli-bin:
runs-on: ubuntu-latest
env:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/delivery-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ on:
default: false

env:
REGISTRY_NAME: 'docker.io'
USER_NAME: 'buildpacksio'
IMG_NAME: 'pack'
USERNAME: 'buildpacksio'

jobs:
deliver-docker:
Expand Down Expand Up @@ -52,29 +53,29 @@ jobs:
with:
ref: v${{ steps.version.outputs.result }}
- name: Determine App Name
run: 'echo "IMG_NAME=${{ env.USERNAME }}/${{ env.IMG_NAME }}" >> $GITHUB_ENV'
run: 'echo "IMG_NAME=${{ env.REGISTRY_NAME }}/${{ env.USER_NAME }}/${{ env.IMG_NAME }}" >> $GITHUB_ENV'
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: buildpacks/github-actions/setup-tools@v5.5.1
- uses: buildpacks/github-actions/setup-tools@v5.8.1
- name: Buildx Build/Publish
run: |
docker buildx build . \
--tag ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }}${{ matrix.suffix }} \
--platform linux/amd64,linux/arm64,linux/s390x \
--platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le \
--build-arg pack_version=${{ steps.version.outputs.result }} \
--build-arg base_image=${{ matrix.base_image }} \
--provenance=false \
--push
- name: Tag Image as Base
if: ${{ (github.event.release != '' || github.event.inputs.tag_latest) && matrix.config == 'base' }}
run: |
crane copy ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} ${{ env.IMG_NAME }}:base
crane copy ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }}${{ matrix.suffix }} ${{ env.IMG_NAME }}:base
- name: Tag Image as Latest
if: ${{ (github.event.release != '' || github.event.inputs.tag_latest) && matrix.config != 'base' }}
run: |
crane copy ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} ${{ env.IMG_NAME }}:latest
crane copy ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }}${{ matrix.suffix }} ${{ env.IMG_NAME }}:latest
2 changes: 1 addition & 1 deletion .github/workflows/delivery-release-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
repo: ['buildpacks/docs', 'buildpacks/samples', 'buildpacks/pack-orb', 'buildpacks/github-actions']
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PLATFORM_GITHUB_TOKEN }}
event-type: pack-release
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/delivery-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [bionic, focal, jammy, lunar]
target: [bionic, focal, jammy, noble]
runs-on: ubuntu-20.04
steps:
- name: Checkout code
Expand Down Expand Up @@ -103,9 +103,9 @@ jobs:
GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
PACKAGE_VERSION: ${{ steps.version.outputs.result }}

- name: Deliver lunar
if: matrix.target == 'lunar'
uses: docker://ubuntu:lunar
- name: Deliver noble
if: matrix.target == 'noble'
uses: docker://ubuntu:noble
with:
entrypoint: .github/workflows/delivery/ubuntu/deliver.sh
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/delivery/archlinux/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Arch Linux

There are 3 maintained packages:
There are two maintained packages by us and one official archlinux package:

- [pack-cli](https://aur.archlinux.org/packages/pack-cli/): The latest release of `pack`, compiled from source.
- [pack-cli](https://archlinux.org/packages/extra/x86_64/pack-cli/): Official Archlinux package in the 'Extra' repo.
- [pack-cli-bin](https://aur.archlinux.org/packages/pack-cli-bin/): The latest release of `pack`, precompiled.
- [pack-cli-git](https://aur.archlinux.org/packages/pack-cli-git/): An unreleased version of `pack`, compiled from source of the `main` branch.

Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/delivery/archlinux/pack-cli/PKGBUILD

This file was deleted.

Loading

0 comments on commit b31178b

Please sign in to comment.