From 991a5c58c8483181417cf8b054cd5cf2fabf9063 Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Sat, 12 Oct 2019 22:44:26 -0400 Subject: [PATCH] Create publish.yml --- .github/workflows/publish.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..9e31ea27 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: Publish + +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run test + + - run: git config --local --list + + - name: Setup GIT + run: | + git checkout master + git config user.email "$GH_EMAIL" + git config user.name "Francisco Hodge" + env: + GH_EMAIL: ${{secrets.GH_EMAIL}} + + - name: Bump version + run: | + npm version patch + git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: npm publish + run: | + npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN + npm run trypublish + env: + NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}