auto icon indicating copy to clipboard operation
auto copied to clipboard

How to do initial setup for new project?

Open tlkiong opened this issue 4 years ago • 6 comments

Describe the bug

Based on the docs here, it says that If your project is already published then ... However, what if my project is not published yet? What should I do? Steps are not clear on this


If I didn't have to do any set up, then when I ran: GH_TOKEN=<token> yarn run auto release -d, the following is showns:

#### 🚀 Enhancement

...

#### 🐛 Bug Fix

- fix: ...

#### ⚠️ Pushed to `main`

ℹ  info      Would have created a release on GitHub for version: null
●  note      The above version would only get released if ran with "shipit" or a custom script that bumps the version using the "version" command

and of course, no version bump was made

tlkiong avatar Jun 25 '21 04:06 tlkiong

auto release is not the command you want. It only publishes release notes as a GitHub release.

Try running auto shipit --dry-run.

laughedelic avatar Jun 25 '21 14:06 laughedelic

@laughedelic The reason I ran auto release is because that command gives me more info on what was happening. Running auto shipit will just tell me no version bump.

Either way, both is the same.

tlkiong avatar Jun 25 '21 14:06 tlkiong

So your project doesn't have any tags and you're running these commands from the master/main branch, right?

Try also running auto info, what does it show?

laughedelic avatar Jun 25 '21 14:06 laughedelic

@laughedelic Erm, I'm not sure how it got fixed but it just suddenly works.

Anyway, back to the main point which is the doc. Perhaps we can update the doc to guide users on what they need to do if its a fresh project rather than one that has a release & tag?

tlkiong avatar Jun 25 '21 14:06 tlkiong

One of the steps to get it working is to create an intial tag. If there is no tag/release on the codebase, Auto freaks out.

I use this workflow and run it when I create a repo:

steps:
      - name: Clone self
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Install Auto
        run: |
          mkdir -p ~/.local/bin && npm config set prefix ~/.local/ && npm install -g auto @auto-it/git-tag

      - name: Create GitHub Labels
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          ~/.local/bin/auto create-labels
        
      - name: Create Initial GitHub Release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: v0.0.0
          release_name: v0.0.0
          body: Initialize

travis-crowder-kr avatar Aug 26 '21 05:08 travis-crowder-kr

Can someone please guide me into how to freaking setup auto for a new repo? I've been trying to get it working as I expect it to work for 2 days now and I'm always running into some issues.

We need a guide on how to start a new project and how the development workflow looks like (and can look like).

As far as I understood, auto should be able to:

  1. find out what kind of version change a commit is (either via PR labels or via conventional commits) (i'm using conventional commits)
  2. create a changelog for the change inside the root and related packages that are affected by the change
  3. commit this changelog
  4. update the version inside all package.json's and create a git-tag as well as a npm version
  5. publish the git-tag and npm package

However, It looks like I don't understand how to get to step 4 and 5, I'm stuck at point 3.

I've taken a look at https://github.com/hipstersmoothie/auto-lerna-gh-actions but I dont understand the workflow @hipstersmoothie used. Maybe you can elaborate the commands you wrote inside your CLI manually and walk me through step-by-step. It looks like you ran auto changelog manually and then commited that change? But which auto-command is causing the Bump independent versions [skip ci]? Did you create the tags manually?

The "getting started" docs are very confusing for a beginner trying to use this library. Don't get me wrong, It looks amazing, but it's not as easy to "get started", even though the guide looks just like that.

mrtnbroder avatar Jan 26 '22 22:01 mrtnbroder