Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Split workflow to dedicated workflows that are triggering a reusable workflow #172

Closed
wants to merge 3 commits into from

Conversation

oriddd
Copy link
Contributor

@oriddd oriddd commented Jan 27, 2022

Split workflow to dedicated workflows that are triggering a reusable workflow.
build_release.yml is the workflow for release.
build_snapshot.yml is the workflow for every push.
build.yml is the reusable workflow.

@oriddd oriddd requested a review from vitalybu as a code owner January 27, 2022 10:01
@mstrelex mstrelex changed the title build: add GitHub actions to upload to the release artifacts a full jar and md5 file Include SDK "fat-jar" and a hash file in releases Jan 27, 2022
build.gradle Outdated
'Compile-Version': project.version
}

archiveFileName = project.name + "-" + project.version + "-FULL.jar"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the -FULL suffix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file (without the suffix) already exists (since the jar task is creating it).
I'll replace the "FULL" suffix with "UBER"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand now. The Standard IMHO is something lower case, e.g. jar-with-dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's changed as part of: #173
The changes on build.gradle file were removed from this PR :)

build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
@@ -86,3 +86,41 @@ jobs:
with:
name: reports
path: build/reports
- name: Define FULL jar name
if: startsWith(github.ref, 'refs/tags/v')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed if the whole flow runs on published releases only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mstrelex
Please review the example I've created in the private repository:
https://github.com/oriddd/java-opensdk/tree/master/.github/workflows

  • The build.yml is a reusable workflow.

  • The build_snapshot.yml is getting triggered by every commit and running the build.yml.

  • The build_release.yml is getting triggered only once a release is created.
    It's running the buid.yml and adding another logic after that.

The main issue is:
Those 2 jobs are running on separate runner machines and the second job (that needs to upload the uberJAR file) doesn't have this jar and must to re-build it.
Do you have any idea how can we solve that problem without re-building (running grade build again)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the logic, please look at the latest changes.
Now, there is a reusable workflow and 2 additional dedicated workflows.

.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
@mstrelex mstrelex changed the title Include SDK "fat-jar" and a hash file in releases Include SDK uberJAR and a hash file in releases Jan 27, 2022
@oriddd oriddd force-pushed the tasks/TP-17043 branch 12 times, most recently from 625f836 to 2ecc764 Compare February 1, 2022 11:22
@oriddd
Copy link
Contributor Author

oriddd commented Feb 1, 2022

@mstrelex @s-glatshtein
This is currently blocked by https://github.community/t/ref-head-in-reusable-workflows/203690/67
Will create new PR with the old approach that has 1 workflow file with actions that are running only for release.
Marking this PR as WIP for future changes once the bug will be fixed.

@oriddd oriddd changed the title Include SDK uberJAR and a hash file in releases WIP: Include SDK uberJAR and a hash file in releases Feb 1, 2022
@oriddd oriddd changed the title WIP: Include SDK uberJAR and a hash file in releases DRAFT: Include SDK uberJAR and a hash file in releases Feb 1, 2022
@mstrelex mstrelex marked this pull request as draft February 2, 2022 12:16
@mstrelex mstrelex changed the title DRAFT: Include SDK uberJAR and a hash file in releases Include SDK uberJAR and a hash file in releases Feb 2, 2022
@oriddd oriddd changed the title Include SDK uberJAR and a hash file in releases Change workflow to use reusable workflow and create new workflow for release to include SDK uberJAR and a hash file as release artifacts Feb 2, 2022
build.gradle Outdated Show resolved Hide resolved
This workflow will triggered by dedicated workflows for snapshot versions and for release versions.

Signed-off-by: ori-d <ori.dafna@testproject.io>
This workflow run the reusable workflow.

Signed-off-by: ori-d <ori.dafna@testproject.io>
This workflow run the reusable workflow.
In addition, it's uploading uberJAR and it's md5 hash to the release artifacts.

Signed-off-by: ori-d <ori.dafna@testproject.io>
@oriddd oriddd changed the title Change workflow to use reusable workflow and create new workflow for release to include SDK uberJAR and a hash file as release artifacts Split workflow to dedicated workflows that are triggering a reusable workflow Feb 3, 2022
@mstrelex mstrelex closed this Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants