Skip to content

Commit

Permalink
ci: introduce stateless release process (#2825)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 authored Dec 5, 2022
1 parent 4087613 commit 78f581c
Show file tree
Hide file tree
Showing 21 changed files with 652 additions and 179 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/devPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,9 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Version packages (no push, no changelog)
- name: Version and publish to Verdaccio
working-directory: dev
run: yarn lerna:version:verdaccio

- name: Release to Verdaccio
working-directory: dev
run: yarn lerna:publish:verdaccio
run: yarn release --type=verdaccio

- name: Create verdaccio-files artifact
uses: actions/upload-artifact@v3
Expand All @@ -300,8 +296,8 @@ jobs:
- name: Create a new Webiny project
working-directory: xyz
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb"}'
Expand Down Expand Up @@ -525,13 +521,9 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Version packages (no push, no changelog)
working-directory: dev
run: yarn lerna:version:verdaccio

- name: Release to Verdaccio
- name: Version and publish to Verdaccio
working-directory: dev
run: yarn lerna:publish:verdaccio
run: yarn release --type=verdaccio

- name: Create verdaccio-files artifact
uses: actions/upload-artifact@v3
Expand All @@ -554,8 +546,8 @@ jobs:
- name: Create a new Webiny project
working-directory: xyz
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb-es"}'
Expand Down
42 changes: 18 additions & 24 deletions .github/workflows/nextPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,9 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Version packages (no push, no changelog)
- name: Version and publish to Verdaccio
working-directory: next
run: yarn lerna:version:verdaccio

- name: Release to Verdaccio
working-directory: next
run: yarn lerna:publish:verdaccio
run: yarn release --type=verdaccio

- name: Create verdaccio-files artifact
uses: actions/upload-artifact@v3
Expand All @@ -300,8 +296,8 @@ jobs:
- name: Create a new Webiny project
working-directory: xyz
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb"}'
Expand Down Expand Up @@ -525,13 +521,9 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Version packages (no push, no changelog)
working-directory: next
run: yarn lerna:version:verdaccio

- name: Release to Verdaccio
- name: Version and publish to Verdaccio
working-directory: next
run: yarn lerna:publish:verdaccio
run: yarn release --type=verdaccio

- name: Create verdaccio-files artifact
uses: actions/upload-artifact@v3
Expand All @@ -554,8 +546,8 @@ jobs:
- name: Create a new Webiny project
working-directory: xyz
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb-es"}'
Expand Down Expand Up @@ -679,7 +671,14 @@ jobs:
workdir: next/cypress
message-text: Cypress tests failed! Screenshots have been placed in this thread, good luck.
npm-release-unstable:
needs: [init, code-analysis, jest-tests, e2e-wby-cms-ddb-cypress-tests, e2e-wby-cms-ddb-es-cypress-tests]
needs:
[
init,
code-analysis,
jest-tests,
e2e-wby-cms-ddb-cypress-tests,
e2e-wby-cms-ddb-es-cypress-tests
]
name: NPM release ("unstable" tag)
runs-on: webiny-js-4-cores
environment: release
Expand Down Expand Up @@ -720,10 +719,5 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "webiny-bot"
- name: Version packages
run: |
yarn lerna version 0.0.0-unstable.$(git rev-parse --short HEAD) --force-publish --no-push --no-git-tag-version --no-changelog --yes
git commit -am "chore: version packages"
- name: Publish packages to NPM
run: yarn lerna publish from-package --dist-tag unstable --yes
- name: Version and publish to NPM
run: yarn release --type=unstable
26 changes: 4 additions & 22 deletions .github/workflows/pullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,12 @@ jobs:
path: .webiny/cached-packages
key: packages-cache-${{ needs.init.outputs.ts }}

- name: Git status
run: git status

- name: Install dependencies
run: yarn --immutable

- name: Git status
run: git status && git diff packages-v6/cli/src/bin.js

- name: Build packages
run: node scripts/buildWithCache.js --build-overrides='${{ env.BUILD_OVERRIDES }}'

- name: Git status
run: git status

- name: Start Verdaccio local server
run: npx pm2 start verdaccio -- -c .verdaccio.yaml

Expand All @@ -232,17 +223,8 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Git status
run: git status

- name: Version packages (no push, no changelog)
run: yarn lerna:version:verdaccio

- name: Git status
run: git status

- name: Release to Verdaccio
run: yarn lerna:publish:verdaccio
- name: Version and publish to Verdaccio
run: yarn release --type=verdaccio

- name: Upload verdaccio files
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -294,8 +276,8 @@ jobs:
- name: Create a new Webiny project
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"eu-central-1"}'
Expand Down
24 changes: 8 additions & 16 deletions .github/workflows/pullRequestsCommandCypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,9 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Version packages (no push, no changelog)
- name: Version and publish to Verdaccio
working-directory: dev
run: yarn lerna:version:verdaccio

- name: Release to Verdaccio
working-directory: dev
run: yarn lerna:publish:verdaccio
run: yarn release --type=verdaccio

- name: Create verdaccio-files artifact
uses: actions/upload-artifact@v3
Expand All @@ -166,8 +162,8 @@ jobs:
- name: Create a new Webiny project
working-directory: xyz
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb"}'
Expand Down Expand Up @@ -404,13 +400,9 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Version packages (no push, no changelog)
working-directory: dev
run: yarn lerna:version:verdaccio

- name: Release to Verdaccio
- name: Version and publish to Verdaccio
working-directory: dev
run: yarn lerna:publish:verdaccio
run: yarn release --type=verdaccio

- name: Create verdaccio-files artifact
uses: actions/upload-artifact@v3
Expand All @@ -433,8 +425,8 @@ jobs:
- name: Create a new Webiny project
working-directory: xyz
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb-es"}'
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release (latest)
on:
workflow_dispatch:
repository_dispatch:
types: [release-latest]
types: [release]

env:
NODE_OPTIONS: --max_old_space_size=4096
Expand Down Expand Up @@ -41,14 +41,5 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Create a release on GitHub
run: yarn lerna:version:latest

- name: Release packages to NPM
run: yarn lerna:publish:latest

- name: Update package versions in the sample project applications' packages
run: 'yarn webiny-versions && yarn prettier:fix && git add . && git commit --m "chore: update package versions (webiny-versions)" --no-verify && git push'

- name: Update and commit "yarn.lock" file
run: 'yarn && git add yarn.lock && git commit --m "chore: update yarn.lock" --no-verify && git push'
- name: Version and Publish
run: yarn release --type=${{ github.event.client_payload.type }} --tag=${{ github.event.client_payload.tag }}
37 changes: 10 additions & 27 deletions .github/workflows/stablePush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,9 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Version packages (no push, no changelog)
- name: Version and publish to Verdaccio
working-directory: v5
run: yarn lerna:version:verdaccio

- name: Release to Verdaccio
working-directory: v5
run: yarn lerna:publish:verdaccio
run: yarn release --type=verdaccio

- name: Create verdaccio-files artifact
uses: actions/upload-artifact@v3
Expand All @@ -297,8 +293,8 @@ jobs:
- name: Create a new Webiny project
working-directory: xyz
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb"}'
Expand Down Expand Up @@ -515,13 +511,9 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Version packages (no push, no changelog)
working-directory: v5
run: yarn lerna:version:verdaccio

- name: Release to Verdaccio
- name: Version and publish to Verdaccio
working-directory: v5
run: yarn lerna:publish:verdaccio
run: yarn release --type=verdaccio

- name: Create verdaccio-files artifact
uses: actions/upload-artifact@v3
Expand All @@ -544,8 +536,8 @@ jobs:
- name: Create a new Webiny project
working-directory: xyz
run: >
npx create-webiny-project@next test-project
--tag next --no-interactive
npx create-webiny-project@local-npm test-project
--tag local-npm --no-interactive
--assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION }}","storageOperations":"ddb-es"}'
Expand Down Expand Up @@ -717,14 +709,5 @@ jobs:
- name: Set git username
run: git config --global user.name "webiny-bot"

- name: Create a release on GitHub
run: yarn lerna:version:beta

- name: Release packages to NPM
run: yarn lerna:publish:beta

- name: Update package versions in the sample project applications' packages
run: 'yarn webiny-versions && yarn prettier:fix && git add . && git commit --m "chore: update package versions (webiny-versions)" --no-verify && git push'

- name: Update and commit "yarn.lock" file
run: 'yarn && git add yarn.lock && git commit --m "chore: update yarn.lock" --no-verify && git push'
- name: Version and publish to NPM
run: yarn release --type=beta
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ schema.graphql
!.yarn/sdks
!.yarn/versions
.pnp.*
lerna.json

# TODO remove after moving traffic splitting config to WPC
gateway.*.json
14 changes: 14 additions & 0 deletions .yarn/patches/@lerna-publish-npm-3.22.1-469707df67
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/index.js b/index.js
index 078012845cadbee7cf45de6f101384ed99d269e5..27968d61d9a5bf8a85b8fc2a44e7e012d1dc7e2a 100644
--- a/index.js
+++ b/index.js
@@ -248,7 +248,8 @@ class PublishCommand extends Command {
}

verifyWorkingTreeClean() {
- return describeRef(this.execOpts).then(checkWorkingTree.throwIfUncommitted);
+ return Promise.resolve();
+ // return describeRef(this.execOpts).then(checkWorkingTree.throwIfUncommitted);
}

detectFromGit() {
7 changes: 2 additions & 5 deletions lerna.json → example.lerna.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"packages": [
"packages/*",
"packages-v6/*"
],
"version": "5.33.2",
"packages": ["packages/*", "packages-v6/*"],
"version": "0.0.0",
"npmClient": "yarn",
"command": {
"version": {
Expand Down
Loading

0 comments on commit 78f581c

Please sign in to comment.