chore(release): 19.0.0-next.0 #26
Workflow file for this run
This file contains 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]+-*' | |
jobs: | |
release-cli: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version-file: '.nvmrc' | |
- run: yarn install --frozen-lockfile --non-interactive | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- run: go version | |
- name: 'Build cli' | |
run: yarn build:cli | |
- uses: actions/github-script@v6 | |
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@v4 | |
- uses: actions/setup-node@v4 | |
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: yarn publish dist/angular-server-side-configuration --tag ${{ steps.npm_tag.outputs.npm_tag }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |