Skip to content

Feat: Release branch #3

Feat: Release branch

Feat: Release branch #3

Workflow file for this run

name: Release
on:
push:
branches: [release]
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"
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}