-
Notifications
You must be signed in to change notification settings - Fork 4
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
Whitelist files to publish + new GitHub workflow to auto tag / release / publish #153
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# GitHub Actions workflows: | ||
# https://docs.github.com/en/actions | ||
|
||
name: Create new `git tag`, create new GitHub release and publish to NPM | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
create-git-tag: | ||
name: Create new `git tag` | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
outputs: | ||
new-tag: ${{ steps.detect-and-tag-new-version.outputs.tag }} | ||
new-version: ${{ steps.detect-and-tag-new-version.outputs.current-version }} | ||
old-version: ${{ steps.detect-and-tag-new-version.outputs.previous-version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# Required to ensure git history is properly checked: | ||
# https://github.com/salsify/action-detect-and-tag-new-version/blob/v2.0.1/README.md?plain=1#L11 | ||
fetch-depth: 2 | ||
|
||
- name: Detect and tag new version | ||
id: detect-and-tag-new-version | ||
uses: salsify/action-detect-and-tag-new-version@v2 | ||
|
||
create-github-release: | ||
if: ${{ needs.create-git-tag.outputs.new-tag }} | ||
name: Create new GitHub release | ||
needs: create-git-tag | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: ncipollo/release-action@v1 | ||
env: | ||
REPO_URL: '${{ github.server_url }}/${{ github.repository }}' | ||
TAGS_DIFF: 'v${{ needs.create-git-tag.outputs.new-version }}...v${{ needs.create-git-tag.outputs.old-version }}' | ||
with: | ||
body: '${{ env.REPO_URL }}/compare/${{ env.TAGS_DIFF }}' | ||
name: Release ${{ needs.create-git-tag.outputs.new-tag }} | ||
tag: ${{ needs.create-git-tag.outputs.new-tag }} | ||
|
||
publish-npm: | ||
if: ${{ needs.create-git-tag.outputs.new-tag }} | ||
name: Publish to NPM | ||
needs: create-git-tag | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12 | ||
# Required if we want to authenticate during the `npm publish`: | ||
# https://github.com/actions/setup-node/blob/v2.4.1/action.yml#L15-L16 | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Install Dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Publish to NPM | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }} |
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a reminder about what is going to happen, "what will be included in the publish?".
Initially, when this PR started and we did not have this entry
package.json/files
, but only our.npmignore
, the files included in the publish were:https://github.com/peopledoc/ember-cli-embedded/runs/3941184198?check_suite_focus=true#step:5:17
Some files of these files are always and automatically included during a publish, no matter what settings we apply (this is a rule from
npm
itself, we can't do anything):https://docs.npmjs.com/cli/v6/configuring-npm/package-json#files
Now, if we apply this rule from
npm
to our initial list of files + our whitelist frompackage.json/files
, we should end up with: