Skip to content

Tweak workflow files to work with GitLabFlow branching #1517

@jescalada

Description

@jescalada

In #1516, we're documenting how release branches work. Our current release-drafter.yml and npm.yml workflows were written assuming that we'd use a GitHubFlow (single main branch for latest release). In order to draft releases and publish to NPM correctly, we need to adapt these two workflows so that they can handle multiple drafts and updating old releases for patching.

Describe the solution you'd like
release-drafter.yml should be updated to make multiple drafts, one for each updated release branch rather than a single draft from main. The workflow must allow to immediately publish the drafts if everything looks fine.

npm.yml should be updated to republish older versions that got patched. Right now, it simply publishes to the latest tag which gets installed by default when running npx @finos/git-proxy, which means that re-publishing old releases could catastrophically override the default install.

      - name: Check if pre-release and publish to NPM
        run: |
          VERSION=$(node -p "require('./package.json').version")
# Only checks if prerelease to decide if latest or rc tag
          if [[ "$VERSION" == *"-"* ]]; then
            echo "Publishing pre-release: $VERSION"
            npm publish --access=public --tag rc
          else
            echo "Publishing stable release: $VERSION"
            npm publish --access=public
          fi

Additional context
#1516 for documentation reference, already updated to reflect the desired behaviour
#1483 for more context on GitLabFlow

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions