chore(release): 17.0.0-next.1 #14
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 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
- run: go version | |
- name: 'Build cli' | |
run: yarn build:cli:upx | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
const fs = require('fs').promises; | |
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 await fs.readdir('./dist/cli')) { | |
console.log(`Adding asset ${file}`); | |
await github.rest.repos.uploadReleaseAsset({ | |
owner, | |
repo, | |
release_id: release.data.id, | |
name: file, | |
data: await fs.readFile(`./dist/cli/${file}`), | |
}); | |
} | |
release-library: | |
runs-on: ubuntu-latest | |
needs: release-cli | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
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 }} |