fix: fix sudo on pkg (#8) #34
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: 'build-test' | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'package.json' | |
cache: 'pnpm' | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm run lint | |
- run: pnpm run test | |
- run: pnpm run build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: ./dist/ | |
test-integration: | |
strategy: | |
fail-fast: false | |
matrix: | |
container: | |
- redhat/ubi9 | |
- oraclelinux:9 | |
- fedora | |
- debian | |
- ubuntu | |
- linuxmintd/mint21-amd64 | |
- opensuse/leap | |
- registry.suse.com/bci/bci-base:15.5 | |
runs-on: ubuntu-latest | |
container: ${{ matrix.container }} | |
steps: | |
# Override GITHUB_PATH by the current PATH to prevent the issue discussed in https://github.com/actions/runner/issues/3210 | |
- run: echo "$PATH" >>"$GITHUB_PATH" | |
# Required for actions | |
- run: zypper install --no-confirm tar gzip | |
if: ${{ matrix.container == 'opensuse/leap' }} | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'package.json' | |
cache: 'pnpm' | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm run test:integration | |
publish: | |
name: Publish to NPM | |
if: github.ref == 'refs/heads/master' | |
needs: [build, test-integration] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
- uses: actions/checkout@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'package.json' | |
registry-url: 'https://registry.npmjs.org' | |
if: ${{ steps.release.outputs.release_created }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: ./dist/ | |
if: ${{ steps.release.outputs.release_created }} | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
if: ${{ steps.release.outputs.release_created }} |