# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages name: SASjs Build and Publish on: push: branches: - master jobs: build: runs-on: ubuntu-latest permissions: contents: write id-token: write strategy: matrix: node-version: [22] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org # 2. Restore npm cache manually - name: Restore npm cache uses: actions/cache@v4 id: npm-cache with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Install Dependencies run: npm ci - name: Check code style run: npm run lint - name: Build Project run: npm run build - name: Clean up ready for publishing run: npm run publishInit - name: Semantic Release run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish to npm with trusted publisher if: success() env: NPM_CONFIG_PROVENANCE: true run: npm publish --access public --provenance - name: Send Matrix message run: curl -XPOST -d "{\"msgtype\":\"m.text\", \"body\":\"New version of @sasjs/adapter has been released! \n Please deploy and run 'dctests' with new adapter to make sure everything is still in place.\"}" https://matrix.4gl.io/_matrix/client/r0/rooms/!jRebyiGmHZlpfDwYXN:4gl.io/send/m.room.message?access_token=${{ secrets.MATRIX_TOKEN }}