diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..e85a7991 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,35 @@ +# Define text file attributes. +# - Treat them as text. +# - Ensure no CRLF line-endings, neither on checkout nor on checkin. +# - Detect whitespace errors. +# - Exposed by default in `git diff --color` on the CLI. +# - Validate with `git diff --check`. +# - Deny applying with `git apply --whitespace=error-all`. +# - Fix automatically with `git apply --whitespace=fix`. + +*.scss text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=4 +*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.ts text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 + +# Define binary file attributes. +# - Do not treat them as text. +# - Include binary diff in patches instead of "binary files differ." +*.gif -text diff +*.gz -text diff +*.ico -text diff +*.jpeg -text diff +*.jpg -text diff +*.png -text diff +*.phar -text diff +*.exe -text diff +*.svgz -text diff +*.ttf -text diff diff --git a/.github/workflows/dry-run.yml b/.github/workflows/dry-run.yml new file mode 100644 index 00000000..13b63592 --- /dev/null +++ b/.github/workflows/dry-run.yml @@ -0,0 +1,66 @@ +on: + push: + branches: + - next + +name: Dry Run + +jobs: + test: + runs-on: ubuntu-latest + if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" + + strategy: + matrix: + node-version: [10.x, 12.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ matrix.node-version }}-yarn- + - run: yarn install + - run: yarn lint + - run: yarn test + + release: + needs: test + runs-on: ubuntu-latest + if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" + + steps: + - uses: actions/checkout@v2 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + - uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: 12.x-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + 12.x-yarn- + - run: yarn install + - name: Deploy + run: | + ssh-agent bash -c 'ssh-add ${{ secrets.SSH_PRIVATE_KEY }}; git push --dry-run git@github.com:xeroxinteractive/config.git' + env: + NPM_TOKEN: ${{secrets.NPM_TOKEN}} + SLACK_WEBHOOK_URL: ${{secrets.NPM_SLACK_WEBHOOK}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}