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

feat: multiarch oci image #56

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
12 changes: 2 additions & 10 deletions .github/workflows/build-rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,5 @@ on:

jobs:
build-rock:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: canonical/craft-actions/rockcraft-pack@main
id: rockcraft
- uses: actions/upload-artifact@v4
with:
name: rock
path: ${{ steps.rockcraft.outputs.rock }}
name: Build rock
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
6 changes: 1 addition & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ concurrency:
cancel-in-progress: true

jobs:

build:
uses: ./.github/workflows/build-rock.yaml

scan:
needs: build
uses: ./.github/workflows/scan-rock.yaml

integration-tests:
needs: build
uses: ./.github/workflows/integration-tests.yaml

publish:
if: github.ref_name == 'main' || startsWith(github.ref_name, 'release-')
# if: github.ref_name == 'main' || startsWith(github.ref_name, 'release-')
needs: [scan, build, integration-tests]
uses: ./.github/workflows/publish-rock.yaml
39 changes: 7 additions & 32 deletions .github/workflows/publish-rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,10 @@ on:

jobs:
publish-rock:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install rockcraft
run: |
sudo snap install rockcraft --classic --channel edge
- uses: actions/download-artifact@v4
with:
name: rock

- name: Import and push to github package
run: |
image_name="$(yq '.name' rockcraft.yaml)"
version="$(yq '.version' rockcraft.yaml)"
rock_file=$(ls *.rock | tail -n 1)
sudo rockcraft.skopeo \
--insecure-policy \
copy \
oci-archive:"${rock_file}" \
docker-daemon:"ghcr.io/canonical/${image_name}:${version}"
docker tag ghcr.io/canonical/${image_name}:${version} ghcr.io/canonical/${image_name}:latest
docker push ghcr.io/canonical/${image_name}:${version}
docker push ghcr.io/canonical/${image_name}:latest
name: Publish rock
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
artifact-prefix: ${{ needs.go-build.outputs.artifact-prefix }}
permissions:
packages: write
contents: write
Loading