chore(deps-dev): bump tslib from 2.8.0 to 2.8.1 #127
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: CI Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.17.0' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build the project | |
run: npm run build | |
- name: Run linter | |
run: npm run lint | |
- name: Run tests | |
run: npm run test:coverage | |
- name: Report coverage to Codacy | |
if: github.ref == 'refs/heads/main' | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
run: wget -qO - https://coverage.codacy.com/get.sh | bash -s -- report -r ./coverage/cobertura-coverage.xml | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
if: github.ref == 'refs/heads/main' | |
with: | |
name: build-artifacts | |
path: ./dist | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ./dist | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.17.0' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release | |
- name: Upload release artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-artifacts | |
path: | | |
./package.json | |
./package-lock.json | |
./CHANGELOG.md | |
docker: | |
runs-on: ubuntu-latest | |
needs: release | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download release artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-artifacts | |
path: ./ | |
overwrite: true | |
- name: Get build arguments | |
id: vars | |
run: | | |
BUILD_DATE=$(date +%Y-%m-%dT%T%z) | |
BUILD_VERSION=$(awk -F\" '/"version":/ {print $4}' package.json) | |
BUILD_REVISION=$(git rev-parse --short HEAD) | |
echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV | |
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV | |
echo "BUILD_REVISION=$BUILD_REVISION" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
- name: Log in to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/dclint:latest | |
${{ secrets.DOCKERHUB_USERNAME }}/dclint:${{ env.BUILD_VERSION }} | |
build-args: | | |
BUILD_DATE=${{ env.BUILD_DATE }} | |
BUILD_VERSION=${{ env.BUILD_VERSION }} | |
BUILD_REVISION=${{ env.BUILD_REVISION }} |