Skip to content

📦 Release

📦 Release #168

Workflow file for this run

# This file was automatically generated by github-actions-wac.
# DO NOT MODIFY IT BY HAND. Instead, modify the source *.wac.ts file(s)
# and run "github-actions-wac build" (or "ghawac build") to regenerate this file.
# For more information, run "github-actions-wac --help".
name: 📦 Release
'on':
workflow_dispatch:
inputs:
branch:
description: Branch to release from
required: true
default: next
type: choice
options:
- next
- dev
- v5-dev
jobs:
constants:
name: Create constants
outputs:
global-cache-key: ${{ steps.global-cache-key.outputs.global-cache-key }}
run-cache-key: ${{ steps.run-cache-key.outputs.run-cache-key }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: actions/checkout@v4
- name: Create global cache key
id: global-cache-key
run: >-
echo "global-cache-key=${{ github.event.inputs.branch }}-${{ runner.os
}}-$(/bin/date -u "+%m%d")-${{ vars.RANDOM_CACHE_KEY_SUFFIX }}" >>
$GITHUB_OUTPUT
- name: Create workflow run cache key
id: run-cache-key
run: >-
echo "run-cache-key=${{ github.run_id }}-${{ github.run_attempt }}-${{
vars.RANDOM_CACHE_KEY_SUFFIX }}" >> $GITHUB_OUTPUT
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
build:
name: Build
needs: constants
runs-on: webiny-build-packages
steps:
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: actions/checkout@v4
with:
path: ${{ github.event.inputs.branch }}
ref: ${{ github.event.inputs.branch }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.global-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.event.inputs.branch }}
- name: Build packages
run: yarn build
working-directory: ${{ github.event.inputs.branch }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
npmReleaseBeta:
needs:
- constants
- build
name: NPM release ("beta" tag)
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
BETA_VERSION: ${{ vars.BETA_VERSION }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: actions/checkout@v4
with:
path: ${{ github.event.inputs.branch }}
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.event.inputs.branch }}
- name: Build packages
run: yarn build
working-directory: ${{ github.event.inputs.branch }}
- name: Create ".npmrc" file in the project root
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
working-directory: ${{ github.event.inputs.branch }}
- name: Set git email
run: git config --global user.email "webiny-bot@webiny.com"
working-directory: ${{ github.event.inputs.branch }}
- name: Set git username
run: git config --global user.name "webiny-bot"
working-directory: ${{ github.event.inputs.branch }}
- name: Version and publish "beta" tag to NPM
working-directory: ${{ github.event.inputs.branch }}
run: yarn release --type=beta
runs-on: ubuntu-latest
npmReleaseLatest:
needs:
- constants
- npmReleaseBeta
name: NPM release ("latest" tag)
environment: release
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
LATEST_VERSION: ${{ vars.LATEST_VERSION }}
steps:
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: actions/checkout@v4
with:
path: ${{ github.event.inputs.branch }}
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v4
with:
path: ${{ github.event.inputs.branch }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.event.inputs.branch }}
- name: Build packages
run: yarn build
working-directory: ${{ github.event.inputs.branch }}
- name: Create ".npmrc" file in the project root
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
working-directory: ${{ github.event.inputs.branch }}
- name: Set git email
run: git config --global user.email "webiny-bot@webiny.com"
working-directory: ${{ github.event.inputs.branch }}
- name: Set git username
run: git config --global user.name "webiny-bot"
working-directory: ${{ github.event.inputs.branch }}
- name: Version and publish "latest" tag to NPM
working-directory: ${{ github.event.inputs.branch }}
run: yarn release --type=latest
runs-on: ubuntu-latest