Skip to content

Commit

Permalink
chore: fix release pipeline (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatomyr authored Aug 7, 2023
1 parent c5c30bc commit b2ded82
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
15 changes: 9 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ Hi! We're really excited that you are interested in contributing to Redocly CLI.
Before submitting a pull request, please make sure the following is done:

1. Fork the repository and create your branch from `main`.
2. Run `npm install` in the repository root.
3. If you’ve fixed a bug or added code that should be tested, don't forget to add tests!
4. Ensure the test suite passes (`npm test`). Tip: `npm test -- --watch TestName` is helpful in development.
5. Format your code with prettier (`npm run prettier`).
6. Each feat/fix PR should also contain a changeset (to create one, run `npx changeset`). Please describe what you've done in this PR using sentence case (you can refer to our [changelog](https://redocly.com/docs/cli/changelog/)). This produces a file in `.changeset` folder. Please commit this file along with your changes.
1. Run `npm install` in the repository root.
1. If you’ve fixed a bug or added code that should be tested, don't forget to add tests!
1. Ensure the test suite passes (`npm test`). Tip: `npm test -- --watch TestName` is helpful in development.
1. Format your code with prettier (`npm run prettier`).
1. Each feat/fix PR should also contain a changeset (to create one, run `npx changeset`; if your changes are scoped to `packages/core` but also affect Redocly CLI behavior, please include the `@redocly/cli` package as well). Please describe what you've done in this PR using sentence case (you can refer to our [changelog](https://redocly.com/docs/cli/changelog/)). This produces a file in `.changeset` folder. Please commit this file along with your changes.

## Development Setup

Expand Down Expand Up @@ -198,4 +198,7 @@ E2E tests are sensitive to any additional output (like `console.log`) in the sou

## Release flow

We use [Changesets](https://github.com/changesets/changesets) flow. After merging a PR with a changeset, the release PR is automatically created. Merging that PR triggers the release process.
We use [Changesets](https://github.com/changesets/changesets) flow.
After merging a PR with a changeset, the release PR is automatically created.

If the pipelines are not starting, close and reopen the PR. Merging that PR triggers the release process.
27 changes: 12 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,7 @@ concurrency:
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test

release:
needs: [test]
name: Release
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -98,13 +86,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Get version
id: get_version
run: |
value="$(cat packages/cli/package.json | jq -r '.version')"
echo "value=$value" >> "$GITHUB_OUTPUT"
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: |
redocly/cli
ghcr.io/redocly/cli
tags: |
${{ steps.get_version.outputs.value }}
latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down Expand Up @@ -149,7 +146,7 @@ jobs:
run: npm i -g @redocly/cli@latest
- name: Test version from NPM
run: |
expected_version="$(cat package.json | jq -r '.version')"
expected_version="$(cat packages/cli/package.json | jq -r '.version')"
actual_version="$(redocly --version)"
if [[ $expected_version == $actual_version ]]; then
echo "The version is correct. Actual version: $actual_version"
Expand All @@ -164,7 +161,7 @@ jobs:
run: docker pull redocly/cli:latest
- name: Test docker image
run: |
expected_version="$(cat package.json | jq -r '.version')"
expected_version="$(cat packages/cli/package.json | jq -r '.version')"
actual_version="$(docker run --rm redocly/cli --version)"
if [[ $expected_version == $actual_version ]]; then
echo "The version is correct. Actual version: $actual_version"
Expand Down
2 changes: 1 addition & 1 deletion scripts/archive-and-upload-bundle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const yargs = require('yargs');
const { execSync } = require('child_process');
const package = require('../package.json');
const package = require('../packages/cli/package.json');

const version = package.version;
const fileName = `openapi-cli.${version}.tar.gz`;
Expand Down

1 comment on commit b2ded82

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 74.45% 3727/5006
🟡 Branches 65.38% 2062/3154
🟡 Functions 66.7% 619/928
🟡 Lines 74.53% 3477/4665

Test suite run success

616 tests passing in 89 suites.

Report generated by 🧪jest coverage report action from b2ded82

Please sign in to comment.