diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 0000000..918f44d --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,2 @@ +titleAndCommits: true +allowMergeCommits: true diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..ebd84d2 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,36 @@ +name: npm-publish +on: + push: + branches: + - main +jobs: + release: + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v3 + - name: setup node + uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Get yarn cache directory path 🛠 + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Cache node_modules 📦 + uses: actions/cache@v3.0.6 + 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: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: install + run: yarn install + - name: build + run: yarn run build + - name: release + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}