adobe / helix-home

The home of Project Helix
54 stars 84 forks source link

Use github actions to run semantic-release and publish to npm #166

Closed tripodsan closed 3 years ago

tripodsan commented 3 years ago

We can not longer use circleci for publish the libraries to npm, but need to use githubactions. this is due to security hardening and the way the npm token is distributed.

the following repositories are affected:

tripodsan commented 3 years ago

The conversion is pretty simple. as soon as the org secret is enabled, just add a release.yaml to the .github/workflows directory with:

name: Semantic Release
on:
  push:
    branches:
      - 'master'

jobs:
  build:
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, '[skip ci]')"
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js 10.x
        uses: actions/setup-node@v1
        with:
          node-version: '10.x'
      - run: npm install
      - run: npm test
      - run: npm run semantic-release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}

And disable the workflow in the circleci config. if several builds needs to run before the release, see this example: https://github.com/adobe/htlengine/blob/master/.github/workflows/semantic-release.yaml

macdonst commented 3 years ago

@tripodsan I enabled the secret in all the repos listed above.

tripodsan commented 3 years ago

@tripodsan I enabled the secret in all the repos listed above.

@macdonst you missed: https://github.com/adobe/helix-documents-support