|
| 1 | +name: Bookmarks rdflib CI/CD |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - bookmarks/rdflib/** |
| 7 | + - .github/workflows/bookmarks-rdflib-ci-cd.yml |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + defaults: |
| 13 | + run: |
| 14 | + working-directory: ./bookmarks/rdflib/ |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + node-version: [ 20 ] |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - name: Use Node.js ${{ matrix.node-version }} |
| 21 | + uses: actions/setup-node@v3 |
| 22 | + with: |
| 23 | + node-version: ${{ matrix.node-version }} |
| 24 | + |
| 25 | + - run: npm ci |
| 26 | + - run: npm run lint |
| 27 | + - run: npm run build |
| 28 | + - run: npm test |
| 29 | + - run: npm run test:e2e |
| 30 | + - name: Save e2e test data |
| 31 | + uses: actions/upload-artifact@v4 |
| 32 | + with: |
| 33 | + name: e2e-test-data |
| 34 | + path: | |
| 35 | + bookmarks/rdflib/src/e2e-tests/.test-data/ |
| 36 | + retention-days: 1 |
| 37 | + - name: Save build |
| 38 | + uses: actions/upload-artifact@v4 |
| 39 | + with: |
| 40 | + name: build |
| 41 | + path: | |
| 42 | + bookmarks/rdflib/dist/ |
| 43 | + bookmarks/rdflib/README.md |
| 44 | + bookmarks/rdflib/package.json |
| 45 | + retention-days: 1 |
| 46 | + |
| 47 | + npm-publish: |
| 48 | + if: github.ref == 'refs/heads/main' |
| 49 | + needs: build |
| 50 | + runs-on: ubuntu-latest |
| 51 | + outputs: |
| 52 | + prereleaseVersion: ${{ steps.prerelease.outputs.version }} |
| 53 | + steps: |
| 54 | + - uses: actions/download-artifact@v4 |
| 55 | + with: |
| 56 | + name: build |
| 57 | + - uses: actions/setup-node@v3 |
| 58 | + with: |
| 59 | + node-version: lts/* |
| 60 | + - uses: rlespinasse/github-slug-action@v4.4.1 |
| 61 | + - name: prerelease version |
| 62 | + run: | |
| 63 | + echo "::set-output name=version::$(npm version prerelease --preid ${GITHUB_SHA_SHORT} --no-git-tag-version)" |
| 64 | + id: prerelease |
| 65 | + - run: echo prerelease version is ${{ steps.prerelease.outputs.version }} |
| 66 | + - uses: JS-DevTools/npm-publish@v3 |
| 67 | + name: Publish @solid-data-modules/bookmarks-rdflib |
| 68 | + with: |
| 69 | + token: ${{ secrets.NPM_TOKEN }} |
| 70 | + tag: ${{ env.GITHUB_REF_SLUG }} |
| 71 | + access: public |
| 72 | + |
| 73 | + npm-release-latest: |
| 74 | + if: github.ref == 'refs/heads/main' |
| 75 | + needs: build |
| 76 | + runs-on: ubuntu-latest |
| 77 | + steps: |
| 78 | + - uses: actions/download-artifact@v4 |
| 79 | + with: |
| 80 | + name: build |
| 81 | + - uses: actions/setup-node@v3 |
| 82 | + with: |
| 83 | + node-version: lts/* |
| 84 | + - uses: JS-DevTools/npm-publish@v3 |
| 85 | + name: Release @solid-data-modules/bookmarks-rdflib |
| 86 | + with: |
| 87 | + token: ${{ secrets.NPM_TOKEN }} |
| 88 | + tag: latest |
| 89 | + access: public |
0 commit comments