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

What steps do I need to take for TypeScript packages? #46

Closed
coaxial opened this issue Oct 25, 2020 · 2 comments
Closed

What steps do I need to take for TypeScript packages? #46

coaxial opened this issue Oct 25, 2020 · 2 comments

Comments

@coaxial
Copy link

coaxial commented Oct 25, 2020

I'm a bit confused as to where the boundary for this action is.

Considering a TypeScript project, what steps should I run so that this action releases a compiled version of it? Is adding a npm run build (where build takes care of the TS->JS compilation and outputs the compiled files to dist/) step between the Checkout and Semantic Release steps enough? How do I tell this action to use the contents of dist/ as the package's contents?

@cycjimmy
Copy link
Owner

It is recommended that to use the @semantic-release/exec plugin to build your code.
And set the pkgroot attribute of @semantic-release/npm for setting the directory path publishing.

  1. Add @semantic-release/exec plugin to extra_plugins in your release workflow file.
steps:
  ...
  - name: Semantic Release
    uses: cycjimmy/semantic-release-action@v2
    with:
      extra_plugins: |
        @semantic-release/exec
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
  1. Set semantic release configuration in your repository.
module.exports = {
  ...	
  "plugins": [
    ...
    ["@semantic-release/exec", {
      "prepareCmd": "your build code here"
    }],
    ["@semantic-release/npm", {
      "pkgRoot": "dist"
    }]
    ...	
  ]
}

@coaxial
Copy link
Author

coaxial commented Oct 26, 2020

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants