Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 2 additions & 54 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,64 +62,12 @@ jobs:
- *build
- *test

master:
<<: *container
steps:
- checkout
- *restore_cache
- *npm_auth
- *yarn_install
- *save_cache
- *prettier
- *build
- *test
- run:
name: Release
command: npx rollingversions publish --canary $CIRCLE_BUILD_NUM

publish:
<<: *container
steps:
- checkout
- *restore_cache
- *npm_auth
- *yarn_install
- *build
- run:
name: Release
command: npx rollingversions publish

workflows:
version: 2
all:
jobs:
- all:
filters:
branches:
ignore:
- master
master:
jobs:
- master:
context: common-env
filters:
branches:
only: master

- publish-approval:
type: approval
context: common-env
requires:
- master

- publish:
context: common-env
filters:
branches:
only: master
requires:
- publish-approval

- all

nightly:
triggers:
- schedule:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows-src/rollingversions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import createWorkflow from 'github-actions-workflow-builder';
import {secrets} from 'github-actions-workflow-builder/context';
import {setup} from './test';

export default createWorkflow(
({setWorkflowName, addTrigger, addJob, setPermissions, whenTrigger}) => {
setWorkflowName('Release');

addTrigger('repository_dispatch', {
types: ['rollingversions_publish_approved'],
});
addTrigger('push', {branches: ['master']});

setPermissions({
'id-token': 'write', // Required for OIDC to publish to NPM
contents: 'write', // To create GitHub releases
});

whenTrigger('push', () => {
addJob('publish_canary', ({add, run}) => {
add(setup());
run('yarn build');
run(
'npx rollingversions publish --canary $GITHUB_RUN_NUMBER --allow-any-branch',
{
env: {
GITHUB_TOKEN: secrets.GITHUB_TOKEN,
},
},
);
});
});
whenTrigger('repository_dispatch', () => {
addJob('publish', ({add, run}) => {
add(setup());
run('yarn build');
run('npx rollingversions publish', {
env: {
GITHUB_TOKEN: secrets.GITHUB_TOKEN,
},
});
});
});
},
);
67 changes: 67 additions & 0 deletions .github/workflows/rollingversions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# !!! This file is auto-generated, do not edit by hand !!!
# To make changes, edit .github/workflows-src/rollingversions.ts and then run:
#
# github-actions-workflow-builder --directory ".github/workflows-src"

name: Release
on:
repository_dispatch:
types:
- rollingversions_publish_approved
push:
branches:
- master
jobs:
publish_canary:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 24.x
registry-url: https://registry.npmjs.org
- name: Get yarn cache directory path
run: echo "::set-output name=dir::$(yarn cache dir)"
id: step_3
- name: Enable Cache
uses: actions/cache@v4
with:
path: |-
${{ steps.step_3.outputs.dir }}
node_modules
packages/*/node_modules
key: ${{ runner.os }}-24.x-${{ hashFiles('yarn.lock') }}-2
- run: yarn install --prefer-offline
- run: yarn build
- run: npx rollingversions publish --canary $GITHUB_RUN_NUMBER --allow-any-branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'repository_dispatch' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 24.x
registry-url: https://registry.npmjs.org
- name: Get yarn cache directory path
run: echo "::set-output name=dir::$(yarn cache dir)"
id: step_3
- name: Enable Cache
uses: actions/cache@v4
with:
path: |-
${{ steps.step_3.outputs.dir }}
node_modules
packages/*/node_modules
key: ${{ runner.os }}-24.x-${{ hashFiles('yarn.lock') }}-2
- run: yarn install --prefer-offline
- run: yarn build
- run: npx rollingversions publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
id-token: write
contents: write
Loading