From 40fb667083e39075034294a661f8de159aaa1b7f Mon Sep 17 00:00:00 2001 From: MrChocolatine <47531779+MrChocolatine@users.noreply.github.com> Date: Tue, 26 Oct 2021 10:48:46 +0100 Subject: [PATCH 1/3] chore: remove unused entry `directories` --- package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.json b/package.json index 6f5ad92d..649f5b76 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,6 @@ "name": "PeopleDoc", "url": "https://github.com/peopledoc" }, - "directories": { - "doc": "doc", - "test": "tests" - }, "scripts": { "build": "ember build --environment=production", "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"", From b64b4eb3829025878164beb8c3101f73f0f59ba5 Mon Sep 17 00:00:00 2001 From: MrChocolatine <47531779+MrChocolatine@users.noreply.github.com> Date: Wed, 20 Oct 2021 18:22:06 +0100 Subject: [PATCH 2/3] build: whitelist files to include when publishing 1. Reduce the size of the final output. 2. Overall, a whitelist of files should be prefer over a blacklist to make things explicit about what exactly is going to be published. Useful readings: - https://docs.npmjs.com/cli/v6/configuring-npm/package-json#files - https://docs.npmjs.com/cli/v6/commands/npm-publish --- .npmignore | 33 --------------------------------- addon/.gitkeep | 0 app/.gitkeep | 0 package.json | 11 +++++++++++ 4 files changed, 11 insertions(+), 33 deletions(-) delete mode 100644 .npmignore delete mode 100644 addon/.gitkeep delete mode 100644 app/.gitkeep diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 88818f2c..00000000 --- a/.npmignore +++ /dev/null @@ -1,33 +0,0 @@ -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ - -# misc -/.bowerrc -/.editorconfig -/.ember-cli -/.env* -/.eslintcache -/.eslintignore -/.eslintrc.js -/.git/ -/.gitignore -/.template-lintrc.js -/.travis.yml -/.watchmanconfig -/bower.json -/config/ember-try.js -/CONTRIBUTING.md -/ember-cli-build.js -/testem.js -/tests/ -/yarn.lock -.gitkeep - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/package.json.ember-try diff --git a/addon/.gitkeep b/addon/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/app/.gitkeep b/app/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/package.json b/package.json index 649f5b76..1f83f9bc 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,17 @@ "name": "PeopleDoc", "url": "https://github.com/peopledoc" }, + "files": [ + "/addon", + "/app", + "/config/environment.js", + "/initializers", + "/instance-initializers", + "/services", + "/types", + "/index.js", + "/tsconfig.json" + ], "scripts": { "build": "ember build --environment=production", "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"", From 7dd0755743dc6b0bf24f0e2f63118e44ee06fe70 Mon Sep 17 00:00:00 2001 From: MrChocolatine <47531779+MrChocolatine@users.noreply.github.com> Date: Wed, 20 Oct 2021 18:22:07 +0100 Subject: [PATCH 3/3] ci: create workflow `tag-release-publish` --- .github/workflows/tag-release-publish.yml | 69 +++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/tag-release-publish.yml diff --git a/.github/workflows/tag-release-publish.yml b/.github/workflows/tag-release-publish.yml new file mode 100644 index 00000000..998c71a8 --- /dev/null +++ b/.github/workflows/tag-release-publish.yml @@ -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 }}