diff --git a/.editorconfig b/.editorconfig index e5fb019..1edf726 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ insert_final_newline = true [*.md] trim_trailing_whitespace = false + +[package.json] +insert_final_newline = false diff --git a/.gitattributes b/.gitattributes index 6deff74..93763d5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ +/dist/** linguist-generated=true /lib/** linguist-generated=true -/node_modules/** linguist-detectable=false diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e00ae68..e393e12 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -10,12 +10,9 @@ Contributions to this project are [released](https://help.github.com/articles/gi 2. Configure and install the dependencies: `npm install` 4. Create a new branch: `git checkout -b my-branch-name` 5. Make your change -6. Compile your Typescript code: `npm run build` -7. Format your code: `npm run format` -8. Install build dependencies: `npm run build-dep` -9. Prune dependencies: `npm run prune` -10. Push to your fork and [submit a pull request](https://github.com/crazy-max/ghaction-github-pages/compare) -11. Pat your self on the back and wait for your pull request to be reviewed and merged. +6. Run pre-checkin: `npm run pre-checkin` +7. Push to your fork and [submit a pull request](https://github.com/crazy-max/ghaction-github-pages/compare) +8. Pat your self on the back and wait for your pull request to be reviewed and merged. Here are a few things you can do that will increase the likelihood of your pull request being accepted: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 72da253..902ca41 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,10 +14,6 @@ jobs: # https://github.com/actions/checkout name: Checkout uses: actions/checkout@v1 - - - # https://github.com/actions/setup-node - name: Set up Node - uses: actions/setup-node@v1 - name: Setup TS run: npm install tslint typescript -g diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index d898315..b93b14d 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -3,11 +3,7 @@ name: master on: push: branches: - - 'master' - paths: - - 'node_modules/**' - - 'package.json' - - '.github/workflows/master.yml' + - master jobs: prune: @@ -22,14 +18,11 @@ jobs: name: Fix detached HEAD run: git checkout ${GITHUB_REF#refs/heads/} - - # https://github.com/actions/setup-node - name: Set up Node - uses: actions/setup-node@v1 - - - name: Prune prod + name: Build run: | - npm run build-dep - npm run prune + npm install + npm run format + npm run build - name: Set up Git env: @@ -43,6 +36,6 @@ jobs: run: | git add . if output=$(git status --porcelain) && [ ! -z "$output" ]; then - git commit -m 'Update node_modules' + git commit -m 'Update generated content' git push fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 970e3c9..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: release - -on: - push: - branches-ignore: - - '**' - tags: - - 'v*.*.*' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - - # https://github.com/actions/checkout - name: Checkout - uses: actions/checkout@v1 - - - name: Prepare - id: prepare - run: | - TAG=${GITHUB_REF#refs/tags/} - MINOR=${TAG%.*} - MAJOR=${MINOR%.*} - echo ::set-output name=tag_name::${TAG} - echo ::set-output name=minor_tag::${MINOR} - echo ::set-output name=major_tag::${MAJOR} - echo ::set-output name=major_exists::$(git show-ref origin/releases/${MAJOR}) - - - name: Set up Git - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - - - name: Checkout releases/${{ steps.prepare.outputs.major_tag }} branch - run: | - git checkout -B releases/${{ steps.prepare.outputs.major_tag }} - if [ -n "${{ steps.prepare.outputs.major_exists }}" ]; then - git branch --set-upstream-to=origin/releases/${{ steps.prepare.outputs.major_tag }} releases/${{ steps.prepare.outputs.major_tag }} - fi - - - # https://github.com/actions/setup-node - name: Set up Node - uses: actions/setup-node@v1 - - - name: NPM production deps - run: | - npm run build-dep - npm run prune - - - name: Commit and push changes - run: | - git add --all - git status --short -uno - git commit -m 'Release ${{ steps.prepare.outputs.tag_name }}' - git show --stat-count=10 HEAD - git push -f origin releases/${{ steps.prepare.outputs.major_tag }} - - - name: Update ${{ steps.prepare.outputs.minor_tag }} tag - run: | - git push origin :refs/tags/${{ steps.prepare.outputs.minor_tag }} - git tag -fa ${{ steps.prepare.outputs.minor_tag }} -m "Release ${{ steps.prepare.outputs.tag_name }}" - git push origin ${{ steps.prepare.outputs.minor_tag }} - - - name: Update ${{ steps.prepare.outputs.major_tag }} tag - run: | - git push origin :refs/tags/${{ steps.prepare.outputs.major_tag }} - git tag -fa ${{ steps.prepare.outputs.major_tag }} -m "Release ${{ steps.prepare.outputs.tag_name }}" - git push origin ${{ steps.prepare.outputs.major_tag }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f757a4..8943ef0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,11 @@ jobs: uses: actions/checkout@v1 - name: Build + run: | + npm install + npm run build + - + name: Gen dummy page run: | mkdir public cat > public/index.html <