diff --git a/.github/workflows/build-publish-npm.yml b/.github/workflows/build-publish-npm.yml index 12fc0d7..e4eef3c 100644 --- a/.github/workflows/build-publish-npm.yml +++ b/.github/workflows/build-publish-npm.yml @@ -5,63 +5,50 @@ on: - "v[0-9]+.[0-9]+.[0-9]+" - "v[0-9]+.[0-9]+.[0-9]+-pre.[0-9]+" permissions: - id-token: write + id-token: write # Required for OIDC contents: read jobs: get_semver: name: Create semver - runs-on: centeva-strix - container: - image: ghcr.io/actions/actions-runner:latest + runs-on: [self-hosted, linux] steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Verify commit is on main for safety - run: git branch --remote --contains | grep origin/main + + - name: Verify commit is on master for safety + run: git branch --remote --contains | grep origin/master - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0.9.7 with: versionSpec: "5.x" - - name: Determine Version id: gitversion uses: gittools/actions/gitversion/execute@v0.9.7 - outputs: semVer: ${{ steps.gitversion.outputs.semVer }} - build_and_publish: name: Build centeva-angular-mentions - runs-on: centeva-strix - container: - image: ghcr.io/actions/actions-runner:latest - needs: - - get_semver + runs-on: [self-hosted, linux] + needs: get_semver steps: - name: Checkout uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: node-version: 24.18.0 - - - name: Set package version + - name: Version run: | cd ./projects/angular-mentions npm version ${{ needs.get_semver.outputs.semVer }} --git-tag-version=false - - - name: Install dependencies - run: npm ci - - - name: Build library (production) - run: npx ng build angular-mentions --configuration production - + - name: Build + run: | + npm ci + npx ng build angular-mentions --configuration production - name: Publish run: | cd ./dist/centeva-angular-mentions - npm publish --ignore-scripts --access public + # OIDC will automatically authenticate if no manual token config is set + npm publish --access public --no-git-tag-version --ignore-scripts diff --git a/.github/workflows/pr-tasks.yml b/.github/workflows/pr-tasks.yml index e15f8b1..56a9079 100644 --- a/.github/workflows/pr-tasks.yml +++ b/.github/workflows/pr-tasks.yml @@ -4,19 +4,21 @@ on: types: [opened, reopened, synchronize, edited] jobs: frontend-checks: - name: Build Angular workspace + name: Test Angular workspace runs-on: centeva-strix + permissions: + contents: read + packages: write container: image: ghcr.io/actions/actions-runner:latest steps: - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 + + - uses: actions/setup-node@v1 with: node-version: 24.x - - - name: Cache npm - uses: actions/cache@v4 + - name: Cache node modules + uses: actions/cache@v3 env: cache-name: cache-node-modules with: @@ -26,21 +28,16 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - - name: Install dependencies - run: npm ci --cache ~/.npm - + - name: Setup frontend + run: | + npm ci --cache ~/.npm - name: Lint run: npx ng lint - - name: Build library run: npx ng build angular-mentions - - name: Build demo app run: npx ng build demo-app - - - name: Test library - run: npx ng test angular-mentions --watch=false - - - name: Test demo app - run: npx ng test demo-app --watch=false + - name: Test + run: | + npx ng test angular-mentions --watch=false + npx ng test demo-app --watch=false