Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update github actions to latest stable #141

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
open-pull-requests-limit: 10
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
- "bot"
10 changes: 5 additions & 5 deletions .github/workflows/bats-assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Test
working-directory: ./util/bats-assert
run: docker buildx bake test
-
name: Login to DockerHub
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Publish
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
workdir: ./util/bats-assert
targets: all
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Validate
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: validate

Expand Down Expand Up @@ -140,25 +140,25 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Test
if: ${{ matrix.typ != 'rhel' }}
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: test
set: |
test-${{ matrix.typ }}.args.TEST_BASE_IMAGE=${{ matrix.image }}
-
name: Test (info)
if: ${{ matrix.typ == 'rhel' }}
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: test-info
set: |
Expand All @@ -172,17 +172,17 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
tonistiigi/xx
Expand All @@ -194,13 +194,13 @@ jobs:
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
files: |
./docker-bake.hcl
Expand Down
105 changes: 60 additions & 45 deletions .github/workflows/ld.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ concurrency:
cancel-in-progress: true

on:
schedule:
- cron: '0 8 */6 * *' # every 6 days
workflow_dispatch:
inputs:
release:
Expand All @@ -26,10 +28,6 @@ on:
- 'src/ld/**'
- 'docker-bake.hcl'

env:
# needs latest for output platform-split support
BUILDKIT_IMAGE: "moby/buildkit:latest"

jobs:
binutils-targets:
runs-on: ubuntu-latest
Expand All @@ -38,7 +36,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Create targets matrix
id: targets
Expand All @@ -61,16 +59,16 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: ${{ matrix.target }}
set: |
Expand All @@ -82,34 +80,44 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: ld64-static-tgz
set: |
ld64-static-tgz.cache-from=type=gha,scope=ld64-static-tgz
ld64-static-tgz.cache-to=type=gha,scope=ld64-static-tgz
ld64-static-tgz.output=type=local,dest=./dist,platform-split=false
ld64-static-tgz.output=type=local,dest=./dist
-
name: List artifacts
name: Rename provenance
run: |
for pdir in ./dist/*/; do
(
cd "$pdir"
binname=$(find . -name '*.tar.gz')
filename=$(basename "${binname%.tar.gz}")
mv "provenance.json" "${filename}.provenance.json"
)
done
-
name: Move and list artifacts
run: |
mv ./dist/**/* ./dist/
tree -nh ./dist
-
name: Upload artifacts
if: ${{ inputs.release }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ld
name: ld-ld64
path: ./dist/*
if-no-files-found: error
retention-days: 1
Expand All @@ -121,7 +129,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Create targets matrix
id: targets
Expand All @@ -144,34 +152,44 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: ${{ matrix.target }}
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,scope=${{ matrix.target }}
*.output=type=local,dest=./dist,platform-split=false
*.output=type=local,dest=./dist
-
name: List artifacts
name: Rename provenance
run: |
for pdir in ./dist/*/; do
(
cd "$pdir"
binname=$(find . -name '*.tar.gz')
filename=$(basename "${binname%.tar.gz}")
mv "provenance.json" "${filename}.provenance.json"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we set the provenance filename with build request instead of renaming later?

Copy link
Collaborator Author

@crazy-max crazy-max Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with 5433bff but filenames are not aligned so needs to rename them anyway 😣: https://github.com/tonistiigi/xx/actions/runs/7783168263/job/21221059915?pr=141#step:7:7

image

I revert this change, I think my initial attempt looks better: #141 (comment)

)
done
-
name: Move and list artifacts
run: |
mv ./dist/**/* ./dist/
tree -nh ./dist
-
name: Upload artifacts
if: ${{ inputs.release }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ld
name: ld-${{ matrix.target }}
path: ./dist/*
if-no-files-found: error
retention-days: 1
Expand All @@ -181,18 +199,16 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: lipo
set: |
Expand All @@ -204,18 +220,16 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
targets: sigtool
set: |
Expand All @@ -231,18 +245,19 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Prepare
run: |
version=$(docker buildx bake ld-linux-amd64-static-tgz --print | jq -cr '.target."ld-linux-amd64-static-tgz".args."BINUTILS_VERSION"')
echo "VERSION=${version}" >> $GITHUB_ENV
-
name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ld
path: ./dist
pattern: ld-*
merge-multiple: true
-
name: GitHub Release
uses: softprops/action-gh-release@v1
Expand Down
Loading
Loading