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

create release in workflow => attach bundle #128

Merged
merged 38 commits into from
Aug 8, 2024

Conversation

mki-c2c
Copy link
Contributor

@mki-c2c mki-c2c commented Jul 30, 2024

JIRA issue

https://jira.camptocamp.com/browse/GSLUX-635

Description

when a version of V4 is tagged (ex GSLUX-635_5278bb4fbd7496cbb092087899d106256e3154a0) the CI will automatically create a release based on this tag and upload a targz ed bundle of the distributed files

The releases created in this way can be used in v3 from Geoportail-Luxembourg/geoportailv3#3180 onwards

Screenshots

image

Copy link
Contributor

GitHub Pages links: * Luxembourg-geoportail: https://geoportail-luxembourg.github.io/luxembourg-geoportail/GSLUX-635_create_release_CI/

Copy link
Contributor

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Thanks for the workflow @mki-c2c ! I think it'd be nice to create the bundle on merges on main as well and make it accessible without the need to be decompressed (maybe on a dedicated branch or via npm).

In gn-ui we publish the lib on npm on every merge for instance.

The web components are published on dedicated branches while the dev branch always stays the same (so this might not work in the same way for our v3 that needs branch, tag or commit changes to update its v4). But maybe we can come up with something similar.

Copy link
Contributor

@AlitaBernachot AlitaBernachot left a comment

Choose a reason for hiding this comment

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

Why building a release on a tag?
This task should have been discussed with the team before.

fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
Copy link
Contributor

Choose a reason for hiding this comment

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

version 16?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well this was copied from the GH-pages script, what version should we use ? does it matter for building the bundle ?

@mki-c2c
Copy link
Contributor Author

mki-c2c commented Jul 30, 2024

Why building a release on a tag? This task should have been discussed with the team before.

Yes, I wanted to present a POC to be discussed, Arnaud's idea was great to put the bundle outside the repo. And github requires a tag to create a release, so the version has to be tagged. I thought also of cleanup which removes all temprary tags and releases when the branch is merged.

Copy link
Contributor

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Thanks for this nice improvement @mki-c2c ! Tested in v3 and works well with (dev) and without (git) docker compose override. (Just needed to recreate the /bundle dir manually and had to restart the compo for the override to work properly).

I think we should still add some doc to the readme (especially for the naming convention for tags, in particular since it's not yet automated). Wondering if it's very practical to make the branch name part of the tag as it will become part of the list git proposes on git checkout GSLUX-XXX, like:

git checkout GSLUX-635_
GSLUX-635_5278bb4fbd7496cbb092087899d106256e3154a0   GSLUX-635_create_release_CI
GSLUX-635_create_release_CI_929e4aa 
GSLUX-635_5eef06fbd2b691b10bc67715bf194fbb13be5512   GSLUX-635_create_release_CI_05077da                  GSLUX-635_create_release_CI_b51758e 
GSLUX-635_877f1af7315cefaf3f7ef447453ad244e15330eb   GSLUX-635_create_release_CI_6606389

Maybe something like

  • PR-XX-commithash for tags on branches
  • PR-XX-merged-commithash for tags on main
  • 1.0.0 for explicit "manual" releases
    would be more practical? WDYT?

I see there are conflicts in the bundle even thought they have been deleted. I guess a rebase will fix this.

Comment on lines 28 to 34
- run: npm ci
- name: Build prod library
shell: bash
run: npm run build:lib:prod
- name: Build prod library
shell: bash
run: npm pack
Copy link
Contributor

Choose a reason for hiding this comment

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

Could probably be done in one step ?

      - name: Build and Pack Prod Library
        shell: bash
        run: |
          npm ci
          npm run build:lib:prod
          npm pack

@mki-c2c mki-c2c force-pushed the GSLUX-635_create_release_CI branch from 6606389 to 2c4f4b9 Compare August 8, 2024 08:58
@mki-c2c mki-c2c merged commit 84c9eea into main Aug 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants