Skip to content

Commit

Permalink
Fix: release workflow (Digital-Ecosystems#55)
Browse files Browse the repository at this point in the history
* fix: removing automatic release

* fix: images and artifacts workflow to trigger on a release publish

* fix: images and artifacts workflow to trigger on a release publish

* fix: images and artifacts workflow to trigger on a release publish

* fix: images and artifacts workflow to trigger on a release publish

* fix: images and artifacts workflow to trigger on a release publish

* fix: images and artifacts workflow to trigger on a release publish

---------

Co-authored-by: Glaucio Jannotti <[email protected]>
  • Loading branch information
PauloLory-ionos and Glaucio Jannotti authored Dec 5, 2023
1 parent a827f59 commit 44f5957
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 14,960 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Create and publish Docker images
name: Build and publish Docker images and Maven artifacts

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
release:
types: [published]

env:
REGISTRY: ghcr.io
Expand All @@ -16,7 +14,6 @@ jobs:
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -26,6 +23,7 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand All @@ -52,26 +50,28 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/connector
tags: |
type=raw,value=latest,enable={{is_default_branch}}
${{ github.sha }}
${{ github.ref_name }}
- uses: sigstore/cosign-installer@main
- name: Install Cosign
uses: sigstore/cosign-installer@main

- name: Write signing key to disk
run: echo "${{ secrets.SIGNING_SECRET }}" > cosign.key

- name: Build and push "connector"
id: build_and_push_connector
id: build-and-push-connector
uses: docker/build-push-action@v4
with:
context: ./connector
file: ./connector/Dockerfile
push: true
tags: ${{ steps.connector-meta.outputs.tags }}
labels: ${{ steps.connector-meta.outputs.labels }}

- name: Sign "connector" image
run: |
cosign sign -y --key cosign.key \
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/connector@${{ steps.build_and_push_connector.outputs.digest }}
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/connector@${{ steps.build-and-push-connector.outputs.digest }}
env:
COSIGN_PASSWORD: ${{ secrets.SIGNING_SECRET_PASSWORD }}

Expand All @@ -82,40 +82,47 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/connector
tags: |
type=raw,value=persistence-latest,enable={{is_default_branch}}
persistence-${{ github.sha }}
${{ github.ref_name }}-persistence
- name: Build and push "connector-persistence"
id: build_and_push_connector-persistence
id: build-and-push-connector-persistence
uses: docker/build-push-action@v4
with:
context: ./connector-persistence
file: ./connector-persistence/Dockerfile
push: true
tags: ${{ steps.connector-persistence-meta.outputs.tags }}
labels: ${{ steps.connector-persistence-meta.outputs.labels }}

- name: Sign "connector-persistence" image
run: |
cosign sign -y --key cosign.key \
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/connector@${{ steps.build_and_push_connector.outputs.digest }}
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/connector@${{ steps.build-and-push-connector-persistence.outputs.digest }}
env:
COSIGN_PASSWORD: ${{ secrets.SIGNING_SECRET_PASSWORD }}

build-and-publish-artifacts:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- name: Build project
run: ./gradlew clean build

- name: Publish artifacts to GitHub Packages
run: NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3 )
./gradlew -Pversion=${NEW_VERSION} -Pgithub_owner=${{ github.repository_owner }} -Pgithub_repo=edc-ionos-s3 publish -Dorg.gradle.project.gitHubUser=${{ github.actor }} -Dorg.gradle.project.gitHubToken=${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'

- name: Build project
run: ./gradlew clean build

- name: Publish artifacts to GitHub Packages
run: |
./gradlew -PextensionsVersion=${{ github.ref_name }} \
-Pgithub_owner=${{ github.repository_owner }} \
-Pgithub_repo=edc-ionos-s3 publish \
-Dorg.gradle.project.gitHubUser=${{ github.actor }} \
-Dorg.gradle.project.gitHubToken=${{ secrets.GITHUB_TOKEN }}
25 changes: 0 additions & 25 deletions .github/workflows/release.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ deployment/kind/vault-keys.json
example/file-transfer-push-daps/terraform/create-daps-clients/connectors
example/file-transfer-push-daps/terraform/build-and-push-docker-images/registry_password.txt
**/.env
node_modules/*
10 changes: 0 additions & 10 deletions .releaserc

This file was deleted.

12 changes: 0 additions & 12 deletions CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 44f5957

Please sign in to comment.