diff --git a/.github/workflows/tap-operator-copy-packages-ci.yaml b/.github/workflows/tap-operator-copy-packages-ci.yaml index b7e689d..32b1d04 100644 --- a/.github/workflows/tap-operator-copy-packages-ci.yaml +++ b/.github/workflows/tap-operator-copy-packages-ci.yaml @@ -37,18 +37,6 @@ jobs: run: mvn spring-boot:build-image -Dspring-boot.build-image.imageName=${{ steps.meta.outputs.tags }} - name: Push Image run: docker push ${{ steps.meta.outputs.tags }} - - name: Archive Release - uses: thedoctor0/zip-release@0.7.5 - with: - type: 'zip' - filename: 'tap-operator.zip' - path: config - command: cp target/classes/META-INF/fabric8/tapresources.org.moussaud.tanzu-v1.yml config/ - - name: Upload Release - uses: ncipollo/release-action@v1.12.0 - with: - artifacts: "tap-operator.zip" - token: ${{ secrets.GITHUB_TOKEN }} build-copy-packages-image: runs-on: ubuntu-latest diff --git a/.github/workflows/tap-operator-copy-packages-release.yaml b/.github/workflows/tap-operator-copy-packages-release.yaml new file mode 100644 index 0000000..d27527f --- /dev/null +++ b/.github/workflows/tap-operator-copy-packages-release.yaml @@ -0,0 +1,83 @@ +name: tap-operator CI +env: + IMAGE_NAME_CP: ${{ github.repository }}-copy-packages + IMAGE_NAME_OPERATOR: ${{ github.repository }} + REGISTRY: ghcr.io +on: + push: + tags: + - "v*" + +jobs: + build-tap-operator: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up JDK 21 for x64 + uses: actions/setup-java@v3 + with: + java-version: "21" + distribution: "temurin" + - name: Run the Maven verify phase + run: mvn --batch-mode --update-snapshots verify + - name: Log in to the container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.3.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_OPERATOR }} + - name: Run the Maven spring-boot:build-image + run: mvn spring-boot:build-image -Dspring-boot.build-image.imageName=${{ steps.meta.outputs.tags }} + - name: Push Image + run: docker push ${{ steps.meta.outputs.tags }} + - name: Archive Release + uses: thedoctor0/zip-release@0.7.5 + with: + type: 'zip' + filename: 'tap-operator.zip' + path: config + command: cp target/classes/META-INF/fabric8/tapresources.org.moussaud.tanzu-v1.yml config/ + - name: Upload Release + uses: ncipollo/release-action@v1.12.0 + with: + artifacts: "tap-operator.zip" + token: ${{ secrets.GITHUB_TOKEN }} + + build-copy-packages-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: initialize carvel tools + uses: carvel-dev/setup-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - run: | + imgpkg version + kbld version + - name: Log in to the container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.3.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_CP }} + - name: Build and push Docker image + uses: docker/build-push-action@v5.1.0 + with: + context: copy-packages + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}