build(deps): bump cookie and express #237
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: test | |
on: | |
- push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v2 | |
- name: use docker to test | |
run: | | |
docker compose run --rm test bash -c 'npm install --legacy-peer-deps --python=python3 && npm run test:coverage && npm run build --python=python3' | |
- name: upload coverage artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage | |
path: coverage/lcov.info | |
if-no-files-found: error | |
- name: Generate dist artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist-folder | |
path: dist/**/* | |
if-no-files-found: error | |
coverage: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: coverage | |
path: coverage | |
- name: Generate coverage in coverall | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
validate: | |
name: check version is valid to release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Validate if can be published | |
run: | | |
REVIEW_JS=`npm view --json` | |
ATUAL_VERSION=`cat package.json | jq '.version'` | |
if [[ `echo ${REVIEW_JS} | jq -c '.versions[]'` ]]; then | |
echo ${REVIEW_JS} | jq -c '.versions[]' | while read line; do | |
if [ "${line}" == "${ATUAL_VERSION}" ]; then | |
echo "$line is equals to ${ATUAL_VERSION}" | |
echo "Version already released!" | |
exit 1 | |
fi | |
done | |
else | |
echo "all clear to go" | |
fi | |
publish: | |
name: NPM package publish | |
needs: | |
- test | |
- validate | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
- uses: actions/download-artifact@v2 | |
with: | |
name: dist-folder | |
path: dist | |
- run: npm ci | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Create Release | |
run: | | |
NEW_TAG=`cat package.json | jq -cr ".version"` | |
NOTES=`git show -s --format="%s%n%n%b"` | |
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token | |
gh release create "v${NEW_TAG}" --title "v${NEW_TAG}" --notes "${NOTES}" |