Merge pull request #84 from ejhayes/ejhayes-patch-1 #27
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
on: | |
push: | |
branches: | |
- main | |
- next | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- if: runner.debug == 1 | |
run: | | |
set | |
cat $GITHUB_EVENT_PATH | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Prepare repository | |
run: git fetch --unshallow --tags | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- name: Create Release | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
npm ci | |
npm run ci:build | |
npx auto shipit | |
- name: Publish Action | |
run: | | |
RELEASE_NAME=releases/$(git describe --tags --abbrev=0 | cut -d- -f2 | cut -d. -f1) | |
npx action-docs -u | |
npm prune --production | |
git checkout --orphan $RELEASE_NAME | |
git rm -f --cached -r . | |
git add -f .github/workflows/tag_next.yml fixtures dist/index.js dist/index.js.map dist/sourcemap-register.js action.yml README.md CHANGELOG.md package-lock.json LICENSE | |
git clean -fdx | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Release created from $GITHUB_SHA" | |
git push origin -f $RELEASE_NAME |