|
1 | | -name: Release |
| 1 | +name: Publish to GitHub Packages |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: |
6 | | - - develop |
| 6 | + - blue-water-autonomy |
7 | 7 | workflow_dispatch: |
8 | 8 |
|
9 | | -permissions: |
10 | | - contents: write |
11 | | - issues: write |
12 | | - pull-requests: write |
13 | | - id-token: write |
14 | | - |
15 | 9 | jobs: |
16 | 10 | release: |
17 | | - name: Release |
18 | 11 | runs-on: ubuntu-latest |
19 | | - if: github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/develop' |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + packages: write |
| 15 | + |
20 | 16 | steps: |
21 | | - - name: Checkout |
| 17 | + - name: Checkout code |
22 | 18 | uses: actions/checkout@v6 |
23 | | - with: |
24 | | - fetch-depth: 0 |
25 | | - persist-credentials: false |
26 | 19 |
|
27 | | - - name: Setup Node.js |
| 20 | + - name: Set up Node.js |
28 | 21 | uses: actions/setup-node@v6 |
29 | 22 | with: |
30 | 23 | node-version: "24" |
31 | | - registry-url: "https://registry.npmjs.org/" |
| 24 | + registry-url: "https://npm.pkg.github.com" |
| 25 | + scope: "@blue-water-autonomy" |
32 | 26 | cache: "npm" |
33 | 27 |
|
34 | 28 | - name: Install dependencies |
35 | 29 | run: npm ci |
36 | 30 |
|
37 | | - - name: Build core and generate wrappers |
| 31 | + - name: Set package name/version |
38 | 32 | working-directory: ./packages/openbridge-webcomponents |
39 | | - run: npm run build:full |
40 | | - |
41 | | - - name: Install wrapper dependencies |
42 | | - run: npm install |
| 33 | + run: | |
| 34 | + npm pkg set name="@blue-water-autonomy/openbridge-webcomponents" |
| 35 | + base=$(node -p "require('./package.json').version.split('-')[0]") |
| 36 | + version="${base}-bwa.${GITHUB_RUN_NUMBER}" |
| 37 | + npm pkg set version="$version" |
43 | 38 |
|
44 | | - - name: Build Angular wrapper |
45 | | - working-directory: ./packages/openbridge-webcomponents-ng |
46 | | - run: npm run build |
47 | | - |
48 | | - - name: Generate GitHub App token |
49 | | - id: app-token |
50 | | - uses: actions/create-github-app-token@v1 |
51 | | - with: |
52 | | - app-id: ${{ secrets.APP_ID }} |
53 | | - private-key: ${{ secrets.APP_PRIVATE_KEY }} |
54 | | - |
55 | | - - name: Release |
| 39 | + - name: Publish to GitHub Packages |
| 40 | + working-directory: ./packages/openbridge-webcomponents |
56 | 41 | env: |
57 | | - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
58 | | - NPM_CONFIG_PROVENANCE: "true" |
59 | | - run: npx semantic-release |
| 42 | + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 43 | + run: npm publish --access=restricted --tag dev |
0 commit comments