Skip to content
Merged
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
55 changes: 29 additions & 26 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: DockerTag
id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
- name: Extract VERSION from GITHUB_REF
run: TAG_NAME="${GITHUB_REF#refs/*/}"; echo "VERSION=$(echo "${TAG_NAME#v}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
Expand All @@ -28,23 +27,30 @@ jobs:
platforms: all
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
- name: Log in to Docker registry (docker.io)
uses: redhat-actions/podman-login@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
- name: Build OCI Image
uses: redhat-actions/buildah-build@v2
id: build-image
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
rustrial/k8s-object-syncer:${{ steps.docker-tag.outputs.tag }}
image: rustrial/k8s-object-syncer
tags: ${{github.sha}} ${{env.VERSION}}
platforms: linux/arm64,linux/amd64
containerfiles: |
./Dockerfile
- name: Push OCI Image to Docker registry (docker.io)
id: push-image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
test-chart:
name: install-chart
runs-on: ubuntu-latest
Expand All @@ -60,9 +66,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: DockerTag
id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
- name: Extract VERSION from GITHUB_REF
run: TAG_NAME="${GITHUB_REF#refs/*/}"; echo "VERSION=$(echo "${TAG_NAME#v}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set up Helm
uses: azure/setup-helm@v3.5
with:
Expand All @@ -77,7 +82,7 @@ jobs:
- name: Install chart
# No --wait, we do not wait for the Deployment to become ready, as it will not become
# ready without valid AWS credentials.
run: (cd charts/k8s-object-syncer && helm install k8s-object-syncer . -n kube-system --create-namespace --set fullnameOverride=k8s-object-syncer --set-string image.tag=${{ steps.docker-tag.outputs.tag }})
run: (cd charts/k8s-object-syncer && helm install k8s-object-syncer . -n kube-system --create-namespace --set fullnameOverride=k8s-object-syncer --set-string image.tag=${{env.VERSION}})
- name: Tests
run: ./.github/e2e-tests.sh
create-release:
Expand All @@ -99,8 +104,6 @@ jobs:
#onlyLastTag: "true"
#stripHeaders: "true"
#stripGeneratorNotice: "true"
- name: Set TAG_NAME
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: "🚀 Create GitHub release"
id: create_release
uses: actions/create-release@v1
Expand Down Expand Up @@ -138,12 +141,12 @@ jobs:
version: "v3.14.4"
- name: Install CR
run: .github/install-cr.sh
- name: Extract VERSION from GITHUB_REF
run: TAG_NAME="${GITHUB_REF#refs/*/}"; echo "VERSION=$(echo "${TAG_NAME#v}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Update Helm Chart versions
run: |
export GIT_TAG="${GITHUB_REF##*/}"
export VERSION="${GIT_TAG#v}"
sed -i "s/version: 0.0.0/version: ${VERSION}/" charts/k8s-object-syncer/Chart.yaml;
sed -i "s/appVersion: 0.0.0/appVersion: ${VERSION}/" charts/k8s-object-syncer/Chart.yaml;
sed -i "s/version: 0.0.0/version: ${{env.VERSION}}/" charts/k8s-object-syncer/Chart.yaml;
sed -i "s/appVersion: 0.0.0/appVersion: ${{env.VERSION}}/" charts/k8s-object-syncer/Chart.yaml;
- name: Package Helm Charts
run: /tmp/cr package charts/k8s-object-syncer
- name: Upload Helm Charts
Expand Down