add release configuration #47
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
name: Release | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'latest' | ||
cache: yarn | ||
cache-dependency-path: yarn.lock | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Build packages | ||
run: yarn run build | ||
- name: Copy README | ||
run: cp README.md ./dist/ng-select/ | ||
- name: Semantic release | ||
run: DEBUG=semantic-release:* npx semantic-release | ||
- name: copy @ng-select/ng-select version to @ng-select/ng-option-highlight | ||
run: | | ||
TEMPFILE=$(mktemp) | ||
jq ".version = $(jq .version ./dist/ng-select/package.json)" \ | ||
./dist/ng-option-highlight/package.json > "$TEMPFILE" | ||
mv "$TEMPFILE" ./dist/ng-option-highlight/package.json | ||
- name: Set up npm registry | ||
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > ~/.npmrc | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: publish @ng-select/ng-option-highlight | ||
run: yarn publish ./dist/ng-option-highlight | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: build demo | ||
run: yarn run build:demo | ||
- name: Deploy demo 🚀 | ||
uses: JamesIves/github-pages-deploy-action@releases/v4 | ||
with: | ||
branch: gh-pages | ||
folder: dist/demo |