Skip to content

Commit

Permalink
Added github ci and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Carminepo2 committed Jul 16, 2024
1 parent 8a89717 commit 1fb1891
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI
on:
push:
branches: main
pull_request:

jobs:
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: ./package.json
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm format:check

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: ./package.json
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm lint

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: ./package.json
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm check

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: ./package.json
- uses: pnpm/action-setup@v4
with:
run_install: true
- run: pnpm build
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish package to GitHub Packages
on:
push:
branches:
- main
paths-ignore:
- "CODEOWNERS"
- "**.md"
- ".**"

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com"
scope: "@pagopa"

- uses: pnpm/action-setup@v2

- run: pnpm i --frozen-lockfile
- run: pnpm build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.BOT_TOKEN }}

0 comments on commit 1fb1891

Please sign in to comment.