1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/.github/workflows/release.yaml
Gastón Fournier 00549ceaa4
fix: build is not present in npm package (#3759)
## About the changes
Before publishing we should build. This is because previously we were building on prepare https://github.com/Unleash/unleash/pull/3736/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L45
2023-05-12 13:24:27 +00:00

56 lines
1.7 KiB
YAML

name: 'Publish to npm'
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Setup to npm
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Build
run: |
yarn install --frozen-lockfile
yarn build
- name: Publish to npm
run: |
LATEST=$(npm show unleash-server version)
TAG=$(node scripts/npm-tag.js $LATEST)
npm publish --tag ${TAG:-latest}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Publish static assets to S3
run: |
aws s3 cp frontend/build s3://getunleash-static/unleash/${{ steps.get_version.outputs.VERSION }} --recursive
- name: Trigger sync
uses: actions/github-script@v6
with:
github-token: ${{ secrets.UNLEASH_CI_BUILDER_GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'ivarconr',
repo: 'unleash-enterprise',
workflow_id: 'continuous_version_sync.yaml',
ref: 'master'
})