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

GHA workflow #360

Merged
merged 2 commits into from
Oct 13, 2023
Merged

GHA workflow #360

merged 2 commits into from
Oct 13, 2023

Conversation

skripted-io
Copy link
Contributor

@skripted-io skripted-io commented Sep 29, 2023

I used @cwillisf GHA template for scratch-vm as a basis.

Additions/changes:

  • A release version ID is generated in the form of "0.2.0-prerelease.20230929153610"
  • Instead of "npx --no -- semantic-release" we are using "npm publish --tag $NPM_TAG"
  • The current commit is tagged with the release version after successful publish

That last bit wasn't tested, because npm publish has a --dry-run flag which can be removed once this code is approved. If the tagging then fails I need to look at that again. fixed with a condition.

Copy link
Contributor

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

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

Great progress! I see a few important differences compared to the CCI config.

@@ -0,0 +1,39 @@
name: Update i18n
Copy link
Contributor

Choose a reason for hiding this comment

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

This repo doesn't need this workflow since it doesn't have any localized UI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Thnx!

@@ -12,3 +12,6 @@ dist/*
# Editors
/#*
*~

# Act
.secrets
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea! I'll add this in some of my work...

export VERSION=${VPKG}-prerelease.${RELEASE_TIMESTAMP}

echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
echo "NPM_TAG=latest" >> $GITHUB_ENV
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is missing the hotfix handling from the CircleCI config:

name: Setup Deploy
command: |
export NODE_ENV=production
export RELEASE_TIMESTAMP=$(date +'%Y%m%d%H%M%S')
echo "export NPM_TAG=latest" >> $BASH_ENV
npm run build
if [ -z "$BEFORE_DEPLOY_RAN" ]; then
VPKG=$($(npm bin)/json -f package.json version)
VERSION=${VPKG}-prerelease.${RELEASE_TIMESTAMP}
echo "export RELEASE_VERSION=${VERSION}" >> $BASH_ENV
npm --no-git-tag-version version $VERSION
if [[ "$CIRCLE_BRANCH" == hotfix/* ]]; then # double brackets are important for matching the wildcard
echo "export NPM_TAG=hotfix" >> $BASH_ENV
fi
git config --global user.email "$(git log --pretty=format:"%ae" -n1)"
git config --global user.name "$(git log --pretty=format:"%an" -n1)"
echo "export BEFORE_DEPLOY_RAN=true" >> $BASH_ENV
fi

Sorry this is so inconsistent between repositories, but this repo in particular has been a source of hotfixes in the past so I think it's important to retain that support

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, yeah I think I ignored it for convenience :-D
on it!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for moving to npm ci and adding a package lockfile! 😎

@cwillisf
Copy link
Contributor

Oh, right... looks like the commitlint step is complaining about the commit messages not following conventional commits. Most of the front-end & editor repositories use that format now.

Copy link
Contributor

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

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

Sorry, I had this review pending and forgot to submit it.
This looks like it'll work! Thanks :)

Comment on lines 6 to 7
push: # Runs whenever a commit is pushed to the repository
branches: [main, develop, hotfix/*]
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that makes sense. Thanks!

Choose a reason for hiding this comment

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

The branch is actually called "master" here.

@skripted-io skripted-io merged commit 9b66b83 into develop Oct 13, 2023
1 check failed
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