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

Replace Jenkins CI/CD with GitHub Actions CI/CD #93

Closed
1 of 4 tasks
mblomdahl opened this issue Oct 21, 2022 · 3 comments · Fixed by #94
Closed
1 of 4 tasks

Replace Jenkins CI/CD with GitHub Actions CI/CD #93

mblomdahl opened this issue Oct 21, 2022 · 3 comments · Fixed by #94
Assignees

Comments

@mblomdahl
Copy link
Member

mblomdahl commented Oct 21, 2022

Initially brought up during review of PR #86, the current CI/CD via Jenkins is broken and needs a replacement to continue structured and robust maintenance of this repository.

Draft acceptance criterion:

  • Document how to add the necessary NPM credentials to the repo, replacing the current NPM_TOKEN = credentials('mblomdahl_npm') secret in Jenkinsfile L#131
  • Evaluate and propose alternative to the current code for generating unique build identifiers, Jenkinsfile L#11-L#67
  • Building from the release/x.y.z branch should push a release candidate to NPM
  • Building from the master branch should push a release to NPM

Ping @gleite-smsi FYI!

@mblomdahl mblomdahl self-assigned this Oct 21, 2022
@carlba
Copy link
Contributor

carlba commented Oct 21, 2022

Nice Github Actions are cool :)

@mblomdahl
Copy link
Member Author

Nice Github Actions are cool :)

It is... Need a React app? GitHub Actions have you covered! 😁 https://github.com/mkdevops-se/web-template-react

mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 21, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 21, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
From [GitHub Packages](https://docs.github.com/en/packages/quickstart), initial iteration towards smithmicro#93. Additionally:
- Up-to-date `.github/` assets for repo
  - `.github/PULL_REQUEST_TEMPLATE` stolen from https://github.com/cortinico/kotlin-android-template/blob/main/.github/PULL_REQUEST_TEMPLATE
  - `.github/ISSUE_TEMPLATE/feature_request.md` stolen from https://github.com/cortinico/kotlin-android-template/blob/main/.github/ISSUE_TEMPLATE/feature_request.md
  - `.github/ISSUE_TEMPLATE/bug_report.md` stolen from https://github.com/cortinico/kotlin-android-template/blob/main/.github/ISSUE_TEMPLATE/bug_report.md
  - `.github/CODEOWNERS` file with repo creator
- Remove `Jenkinsfile` and `.travis.yml` CI/CD configs
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
Additionally:
- Auto-commit pre-release `package.json` updates in "Publish Pre-Release" workflow
- Comment-out time-consuming install/build/lint steps for faster iterations
- Add `contents:write` permission for `publish-prerelease` GHA
- Add `npm run docs` to GitHub Actions CI/CD
- Try `Co-authored-by: <actor>` for GitHub Actions commit, https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
- Fetch all tags and history on release
- Moar badge 🏷️ and prettier names 📝
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
- `github.com/mblomdahl` fork -> `github.com/smithmicro` upstream
- `issue-93-gh-actions` feature branch -> default branch `master`
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
- `github.com/mblomdahl` fork -> `github.com/smithmicro` upstream
- `issue-93-gh-actions` feature branch -> default branch `master`
- Only run "Publish Release" and "Publish Pre-Release" workflows on main repo
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
- `github.com/mblomdahl` fork -> `github.com/smithmicro` upstream
- `issue-93-gh-actions` feature branch -> default branch `master`
- Only run "Publish Release" and "Publish Pre-Release" workflows on main repo
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
- `github.com/mblomdahl` fork -> `github.com/smithmicro` upstream
- `issue-93-gh-actions` feature branch -> default branch `master`
- Only run "Publish Release" and "Publish Pre-Release" workflows on main repo
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
- `github.com/mblomdahl` fork -> `github.com/smithmicro` upstream
- `issue-93-gh-actions` feature branch -> default branch `master`
- Only run "Publish Release" and "Publish Pre-Release" workflows on main repo
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
- `github.com/mblomdahl` fork -> `github.com/smithmicro` upstream
- `issue-93-gh-actions` feature branch -> default branch `master`
- Only run "Publish Release" and "Publish Pre-Release" workflows on main repo
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 22, 2022
- `github.com/mblomdahl` fork -> `github.com/smithmicro` upstream
- `issue-93-gh-actions` feature branch -> default branch `master`
- Only run "Publish Release" and "Publish Pre-Release" workflows on main repo
@mblomdahl
Copy link
Member Author

mblomdahl commented Oct 22, 2022

/.../

Draft acceptance criterion:

  • Document how to add the necessary NPM credentials to the repo, replacing the current NPM_TOKEN = credentials('mblomdahl_npm') secret in Jenkinsfile L#131
  • Evaluate and propose alternative to the current code for generating unique build identifiers, Jenkinsfile L#11-L#67
  • Building from the release/x.y.z branch should push a release candidate to NPM
  • Building from the master branch should push a release to NPM

/.../

Upon reading further on how to implement this, imagine my surprise when reviewing my favorite Atlassian document covering Gitflow Workflow. In their latest version they start off with the following ingress:

Gitflow Workflow

Gitflow is a legacy Git workflow that was originally a disruptive and novel strategy for managing Git branches. Gitflow has fallen in popularity in favor of trunk-based workflows, which are now considered best practices for modern continuous software development and DevOps practices. Gitflow also can be challenging to use with CI/CD. This post details Gitflow for historical purposes.

So, if not even Atlassian got my back on this topic, it's time to abandon the Gitflow Workflow idea. I will delete the develop branch and redefine the final acceptance criterion for this ticket as follows:

  • Builds from the master branch should publish a pre-release to NPM and GitHub Packages [GHP]
  • GitHub Releases on the master branch should publish a release to NPM and GitHub Packages [GHP]
  • The scripts that are available to Continuous Integration (compile, minify, lint & API docs) should be run on any branch or pull request
  • The GitHub Actions @actions-user must be able to commit version increments directly to the main branch, bypassing the pull request requirement that applies to other users

(Ping to old maintainers @carlba & @akebrissman, FYI!)

mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 23, 2022
- `github.com/smithmicro` upstream -> `github.com/mblomdahl` fork
- default branch `master` -> `issue-93-gh-actions` feature branch
- Only run "Publish Release" and "Publish Pre-Release" workflows on fork repo
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 23, 2022
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 23, 2022
- Use `persist-credentials: false`, "... otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token" (from https://github.com/ad-m/github-push-action#readme)
- Always fetch latest `default` branch before publishing pre-release
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 23, 2022
- Add debug step for event properties
- Only publish pre-release on main repo, pull request builds should not trigger publishing
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 23, 2022
After merging smithmicro#94, we find that GitHub Packages \[GHP\], does not accept publishing of un-scoped packages. Instead of giving up on GHP entirely, let's publish this under two different names:
1. On NPM, as always, it's the `mapbox-gl-circle` package
2. On GHP, it's the same code as on NPM but published as the "`@smithmicro/mapbox-gl-circle`" package
mblomdahl added a commit to mblomdahl/mapbox-gl-circle that referenced this issue Oct 23, 2022
After merging smithmicro#94, we find that GitHub Packages \[GHP\], does not accept publishing of un-scoped packages. Instead of giving up on GHP entirely, let's publish this under two different names:
1. On NPM, as always, it's the `mapbox-gl-circle` package
2. On GHP, it's the same code as on NPM but published as the "`@smithmicro/mapbox-gl-circle`" package
mblomdahl added a commit that referenced this issue Oct 23, 2022
After merging #94, we find that GitHub Packages \[GHP\], does not accept publishing of un-scoped packages. Instead of giving up on GHP entirely, let's publish this under two different names:
1. On NPM, as always, it's the `mapbox-gl-circle` package
2. On GHP, it's the same code as on NPM but published as the "`@smithmicro/mapbox-gl-circle`" package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants