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

Automated Release #30

Open
akinncar opened this issue Jul 17, 2022 · 6 comments
Open

Automated Release #30

akinncar opened this issue Jul 17, 2022 · 6 comments
Labels
dev-ops Development operations including CI/CD, versioning, etc. feature-request New feature requested by the community

Comments

@akinncar
Copy link
Contributor

What about automated releases?
Every commit to main branch can be a new version

Workflow:

name: release
on: push

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 14.x

      - run: yarn install
      - run: yarn test
      - run: yarn prepare

      - name: Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: npx semantic-release --branches main
@mrousavy
Copy link
Member

I like that idea and wanted to try it in all my repos (VisionCamera, MMKV, Blurhash, ...) but never got the chance to do it, since I also had to think about a manual way to trigger it (because a release is a commit and that would be an infinite loop), how would you solve that problem?

Maybe we can also trigger a PR whenever a dependency changes (like RN Skia), run pod install, and on merge a new version gets released

@akinncar
Copy link
Contributor Author

you don't need to do a release commit using semantic-release, you can use "version": "0.0.0", in your package.json, semantic-release will bump the lib version using github tags, and according to your last commit

Take a look into semantic-release README

Commit message Release type
fix(pencil): stop graphite breaking when too much pressure applied Patch Fix Release
feat(pencil): add 'graphiteWidth' option Minor Feature Release
perf(pencil): remove graphiteWidth optionBREAKING CHANGE: The graphiteWidth option has been removed.The default graphite width of 10mm is always used for performance reasons. Major Breaking Release(Note that the BREAKING CHANGE: token must be in the footer of the commit)


You can also manually cancel every build after pushing to master, so if you have for example 10 commits that will cancel builds, the next commit will release a new version with these 11 last commits.
I really recommend you to try to do a PoC with that because it's a good life safer

@mrousavy
Copy link
Member

Oh, that's good to know! Do you know if this also works with 2FA enabled on npm? Is there a special token that can bypass 2FA, or do I have to disable it for that to work?

@akinncar
Copy link
Contributor Author

You don't need to disable it! you can generate a specific token for automations
image

@mrousavy
Copy link
Member

Awesome! I'll check it out thanks Akinn!

@chrispader
Copy link
Member

I can maybe work on that soon. Have been working on CI/CD and automation a lot lately, so i hope i'll get it right 😅

@chrispader chrispader added feature-request New feature requested by the community dev-ops Development operations including CI/CD, versioning, etc. labels Sep 12, 2022
@chrispader chrispader changed the title Automated Relase Automated Release Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-ops Development operations including CI/CD, versioning, etc. feature-request New feature requested by the community
Projects
None yet
Development

No branches or pull requests

3 participants