chore(release): 21.0.1 #31
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| - 'v[0-9]+.[0-9]+.[0-9]+-*' | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| release-cli: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| cache: yarn | |
| node-version-file: '.nvmrc' | |
| - run: yarn install --frozen-lockfile --non-interactive | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - run: go version | |
| - name: 'Build cli' | |
| run: yarn build:cli | |
| - uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const { owner, repo } = context.repo; | |
| const tagName = context.ref.split('/')[2]; | |
| console.log(`Creating release for ${owner} in ${repo} at ${tagName}`); | |
| const release = await github.rest.repos.createRelease({ | |
| owner, | |
| repo, | |
| tag_name: tagName, | |
| generate_release_notes: true, | |
| draft: true, | |
| }); | |
| for (const file of fs.readdirSync('./dist/cli')) { | |
| console.log(`Adding asset ${file}`); | |
| await github.rest.repos.uploadReleaseAsset({ | |
| owner, | |
| repo, | |
| release_id: release.data.id, | |
| name: file, | |
| data: await fs.readFileSync(`./dist/cli/${file}`), | |
| }); | |
| } | |
| release-library: | |
| runs-on: ubuntu-latest | |
| needs: release-cli | |
| permissions: read-all | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| cache: yarn | |
| node-version-file: '.nvmrc' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: yarn install --frozen-lockfile --non-interactive | |
| - name: 'Build library' | |
| run: yarn build:lib | |
| - name: 'Publish: Determine npm tag' | |
| id: npm_tag | |
| run: | | |
| if [[ "$REF" == *"-"* ]] | |
| then | |
| echo "npm_tag=next" >> $GITHUB_OUTPUT | |
| else | |
| echo "npm_tag=latest" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| REF: ${{ github.ref }} | |
| - name: 'Publish: angular-server-side-configuration' | |
| run: | | |
| npm install --global npm@latest | |
| cd dist/angular-server-side-configuration | |
| npm publish --tag ${{ steps.npm_tag.outputs.npm_tag }} |