Merge pull request #22 from sinaa/patch-1 #37
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: [main] | |
paths-ignore: ["**.md"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
fetch-depth: "0" | |
- run: git fetch --depth=1 origin main +refs/tags/*:refs/tags/* | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://registry.npmjs.org/ | |
cache: "yarn" | |
- uses: oleksiyrudenko/gha-git-credentials@v2-latest | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: "Install" | |
run: yarn install | |
- name: Create envfile for testing | |
run: | | |
touch .env | |
echo ACCOUNT_ID=${{ secrets.ACCOUNT_ID }} >> .env | |
echo API_TOKEN=${{ secrets.API_TOKEN }} >> .env | |
echo PHONE_ID=${{ secrets.PHONE_ID }} >> .env | |
echo MESSAGE_TO=${{ secrets.MESSAGE_TO }} >> .env | |
- name: "Test" | |
run: yarn test | |
- name: Upload coverage reports to Codecov | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -t ${CODECOV_TOKEN} | |
- name: "Run build" | |
run: yarn run build | |
# Semantic release is configured to create a tag and publish the package to npm | |
- name: "Version and Npm publish" | |
run: npx semantic-release |