stacks-network / stacks-test-tools

Repo for testing
MIT License
3 stars 7 forks source link

CI: Workflow to Publish to npm if Package Version is Changed #7

Open BowTiedDevOps opened 3 months ago

BowTiedDevOps commented 3 months ago

Description

As per https://github.com/stacks-network/stacks-test-tools/issues/6, a workflow that automatically pushes packages to npm when it detects a version changed is a good addition, because some developers that update these packages might not have the permissions to publish themselves, and it makes their jobs easier by not having to worry about uploading the package once it's updated - that is now automated.

Closes #6

Notes:

Workflow runs:

NPM Profile (Published Packages): https://www.npmjs.com/~bowtieddevops

Tag @wileyj and @hugocaillard because I can't add reviewers on this repo.

wileyj commented 3 months ago

fyi i've added the npm auth token to this repo

BowTiedDevOps commented 3 months ago

@hugocaillard @MarvinJanssen After talking to Jesse, we've come to a solution regarding the access option - we will keep it public (if anyone wants to publish a private package, this ain't the place) and I'll change to an action that makes parsing the args to npm publish easier. I do have 1 question regarding the solo npm ci step though (silly me thought it comes from Continuous Integration) - it's useless rn, I can either remove it or do a npm ci && npm test command which will look like this:

- name: Test Package
  id: test_package
  run: |
    cd ${{ needs.check_version_change.outputs.PACKAGE_PATH }}
    npm ci
    npm test

Question is - do we want to test before publish or not?

hugocaillard commented 3 months ago

Yes npm ci is a bit badly named i think Yes I think it's better to run the tests before publishing 👍

BowTiedDevOps commented 3 months ago

Run with npm test and publish after latest commit: https://github.com/BowTiedDevOps/stacks-test-tools/actions/runs/8570853362/job/23489745755