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

Headless release (onejob) #5568

Closed
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
268 changes: 57 additions & 211 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ env:

jobs:
# --------------------------------------------------
# job: assemble
# job: release
# --------------------------------------------------
assemble:
release:
name: Assemble
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 30
steps:
# setup steps
# --------------------------
# setup
# --------------------------
- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -30,226 +32,96 @@ jobs:
architecture: x64
cache: gradle

# build steps
- name: Compile
run: make distribution
- name: Setup AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
aws-access-key-id: ${{ secrets.AWS_DEPLOY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEPLOY_SECRET_ACCESS_KEY }}

# upload steps
- name: Upload artifacts (libs)
uses: actions/upload-artifact@v4
- name: Login to Docker hub
uses: docker/login-action@v3
with:
retention-days: 3
name: libs
path: modules/*/build/libs/
username: ${{ secrets.DOCKER_HUB_ID }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Login to Seqera registry
uses: docker/login-action@v3
with:
registry: ${{ vars.SEQERA_PUBLIC_CR_URL }}
username: ${{ secrets.SEQERA_PUBLIC_CR_USER }}
password: ${{ secrets.SEQERA_PUBLIC_CR_PASSWORD }}

# --------------------------
# assemble
# --------------------------
- name: Compile
run: make distribution

- name: Upload artifacts (distribution)
# --------------------------
# upload artifacts
# --------------------------
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
retention-days: 3
name: distribution
path: build/releases/
path: |
modules/*/build/libs/
build/releases/

- name: Upload artifacts (plugins)
uses: actions/upload-artifact@v4
with:
retention-days: 3
compression-level: 0
name: plugins
path: |
plugins/build/libs/
plugins/*/build/libs/

# --------------------------------------------------
# job: tag
# --------------------------------------------------
tag:
name: Tag
runs-on: ubuntu-latest
timeout-minutes: 15
needs: assemble
permissions:
contents: write
steps:
# setup steps
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true

# execute steps
# --------------------------
# tag
# --------------------------
- name: Tag
run: bash .github/scripts/tag-release.sh

# --------------------------------------------------
# job: deploy-maven
# --------------------------------------------------
deploy-maven:
name: Deploy to Maven
runs-on: ubuntu-latest
needs: tag
timeout-minutes: 15
steps:
# setup steps
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true

- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
architecture: x64
cache: gradle

- name: Download artifacts (libs)
uses: actions/download-artifact@v4
with:
name: libs
path: modules

# deploy step
# --------------------------
# deploy-maven
# --------------------------
- name: Deploy to maven
run: bash .github/scripts/deploy-to-maven.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_DEPLOY_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_DEPLOY_SECRET_ACCESS_KEY }}
MAVEN_PUBLISH_URL: ${{ vars.MAVEN_PUBLISH_URL }}

# --------------------------------------------------
# job: deploy-s3
# --------------------------------------------------
deploy-s3:
name: Deploy to S3
runs-on: ubuntu-latest
needs: tag
timeout-minutes: 15
steps:
# setup steps
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true

- name: Setup AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
aws-access-key-id: ${{ secrets.AWS_DEPLOY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEPLOY_SECRET_ACCESS_KEY }}

- name: Download artifacts (distribution)
uses: actions/download-artifact@v4
with:
name: distribution
path: build/releases

# deploy step
# --------------------------
# deploy-s3
# --------------------------
- name: Deploy to S3
run: bash .github/scripts/deploy-to-s3.sh
env:
S3_RELEASE_BUCKET: ${{ vars.S3_RELEASE_BUCKET }}

# --------------------------------------------------
# job: deploy-docker
# --------------------------------------------------
deploy-docker:
name: Deploy to Docker
runs-on: ubuntu-latest
needs:
- tag
- deploy-s3
timeout-minutes: 15
steps:
# setup steps
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true

- name: Login to Docker hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_ID }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Login to Seqera registry
uses: docker/login-action@v3
with:
registry: ${{ vars.SEQERA_PUBLIC_CR_URL }}
username: ${{ secrets.SEQERA_PUBLIC_CR_USER }}
password: ${{ secrets.SEQERA_PUBLIC_CR_PASSWORD }}

# deploy step
# --------------------------
# deploy-docker
# --------------------------
- name: Deploy to docker
run: bash .github/scripts/deploy-to-docker.sh
env:
SEQERA_REGISTRY: ${{ vars.SEQERA_PUBLIC_CR_URL }}

# --------------------------------------------------
# job: deploy-github
# --------------------------------------------------
deploy-github:
name: Deploy to Github
runs-on: ubuntu-latest
needs: tag
timeout-minutes: 15
steps:
# setup steps
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true

- name: Download artifacts (distribution)
uses: actions/download-artifact@v4
with:
name: distribution
path: build/releases

# deploy steps
# --------------------------
# deploy-github
# --------------------------
- name: Create github release
run: bash .github/scripts/deploy-to-github.sh
env:
GH_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}

# --------------------------------------------------
# job: deploy-plugins
# --------------------------------------------------
deploy-plugins:
name: Deploy Plugins
runs-on: ubuntu-latest
needs: tag
timeout-minutes: 15
steps:
# setup steps
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true

- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
architecture: x64
cache: gradle

- name: Download artifacts (plugins)
uses: actions/download-artifact@v4
with:
name: plugins
path: plugins

# deploy steps
# --------------------------
# deploy-plugins
# --------------------------
- name: Deploy plugins to maven
run: bash .github/scripts/deploy-plugins-to-maven.sh
env:
Expand All @@ -272,35 +144,9 @@ jobs:
GH_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
PLUGINS_INDEX_JSON: ${{ vars.PLUGINS_INDEX_JSON }}


# --------------------------------------------------
# job: publish
# --------------------------------------------------
publish:
name: Publish release
runs-on: ubuntu-latest
needs:
- deploy-s3
- deploy-docker
- deploy-maven
- deploy-github
timeout-minutes: 15
steps:
# setup steps
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true

- name: Setup AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
aws-access-key-id: ${{ secrets.AWS_DEPLOY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEPLOY_SECRET_ACCESS_KEY }}

# deploy steps
# --------------------------
# publish
# --------------------------
- name: Publish release
run: bash .github/scripts/publish-release.sh
env:
Expand Down
Loading