Skip to content

Commit

Permalink
Release workflows refactor (#38)
Browse files Browse the repository at this point in the history
More clear naming. Also introducing `changeset` workflow and describing  the whole lifecycle in the README

#### ✔️ Checklist

- [x] Added or updated documentation (if applicable)
  • Loading branch information
jvilimek authored Sep 22, 2022
1 parent a94816d commit 004231d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI pipeline
name: 'CI workflow'

on:
pull_request:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Prepare release PR workflow

on:
push:
branches:
- main

jobs:
create-release-pr:
name: Create Changeset PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Create Release Pull Request
uses: changesets/action@v1
with:
# Calls out to `changeset version`, but also runs prettier
version: yarn release
title: 'Release new version(s)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'CD pipeline'
name: 'Release and publish Workflow'

on:
workflow_dispatch:
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ Name | Description
---------|----------
[score-card](https://github.com/Oriflame/backstage-plugins/blob/main/plugins/score-card/README.md) | Main idea behind it comes from a need to somehow visualize maturity of our services and to establish a process how to improve it (discuss with the teams what to focus on next).

## Workflows

We use GitHub actions to check build, unit & end to end test and other validations during pull requests. We use them also to prepare releases and publish npm packages.

In overview:

- create branch, commit changes, run `yarn changeset`, commit and create PR -> [CI workflow](#ci-workflow) will run
- once merged to `main` (on push) [Prepare release PR workflow](#prepare-release-pr-workflow) -> `Release new version(s)` pull request is created automatically. It shall increase versions of packages and update changelogs in respective plugins and cleanup the `.changeset` folder.
- once this PR is merged to `main` [Release and publish Workflow](#release-and-publish-workflow) will create a new release on GitHub and also publishes changed plugins.

### CI workflow

Source: `.github/workflows/ci.yml`

Shall be executed during `pull requests` to validate changes and also during push to `main` branch to keep validating the main trunk.

## Prepare release PR workflow

Source: `.github/workflows/release-prepare.yml`

Shall be executed on push to `main`. It runs `yarn release` = increase versions of packages and update changelogs in respective plugins and cleanup the `.changeset` folder. It comit the changes in a new branch and prepare a new PR `Release new version(s)`.

### Release and publish Workflow

Source: `.github/workflows/ci.yml`

Shall be executed on push to `main`. In case the package versions are changed (which are by the previous PR) it creates a new release on GitHub and also publishes changed plugins to npm repository.

## Thank you note

When creating this repository (pipelines, e2e tests, monorepo setup...) we were inspired a lot by a following repository [roadie-backstage-plugins](https://github.com/RoadieHQ/roadie-backstage-plugins).
1 change: 0 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
],
"stabilityDays": 3,
"internalChecksFilter": "strict",
"bumpVersion": "patch",
"packageRules": [
{
"paths": [
Expand Down

0 comments on commit 004231d

Please sign in to comment.