Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): remove msr #2364

Merged
merged 4 commits into from
Oct 15, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
2 changes: 2 additions & 0 deletions .changeset/shy-icons-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
30 changes: 3 additions & 27 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,11 @@ description: Build all packages
inputs:
args:
description: Backstage CLI repo build arguments
default: '@janus-idp/*'
node-version:
description: Node.js version
required: true
default: '20'
default: --filter=@janus-idp/*

runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'

# already done when calling the actions/test/ action.
# - name: Setup local Turbo cache
# uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1

# already done when calling the actions/test/ action.
# - name: Install dependencies
# shell: bash
# run: |
# yarn install
# if [[ $(git diff --name-only . || true) ]]; then
# echo "After 'yarn install', workspace is dirty! The following files have changed:"
# echo
# git diff --name-only . || true
# fi

- name: Build all packages
shell: bash
run: yarn build --filter=${{ inputs.args }} --concurrency=1
run: yarn run build ${{ inputs.args }}
25 changes: 6 additions & 19 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,14 @@ description: Test Node.js package
inputs:
args:
description: Backstage CLI repo build arguments
default: '@janus-idp/*'
node-version:
description: Node.js version
required: true
default: '20'
default: --filter=@janus-idp/*

runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1

- name: Install dependencies
- name: Check if workspace is dirty
shell: bash
run: |
yarn install
changed_files="$(git diff --name-only . || true)"
if [[ $changed_files ]]; then
echo "After 'yarn install', workspace is dirty! The following files have changed:"
Expand All @@ -38,12 +25,12 @@ runs:

- name: Run prettier
shell: bash
run: yarn prettier:check
run: yarn prettier:check ${{ inputs.args }}

- name: Run lint
shell: bash
run: yarn lint --filter=${{ inputs.args }}
run: yarn run lint:check ${{ inputs.args }}

- name: Run tests
shell: bash
run: yarn test --filter=${{ inputs.args }}
run: yarn run test ${{ inputs.args }}
43 changes: 43 additions & 0 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Pull Request - Builds

on: pull_request

env:
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }}
TURBO_SCM_HEAD: ${{ github.sha }}

concurrency:
group: push
cancel-in-progress: false

jobs:
build:
name: Build with Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1

- name: Install dependencies
run: |
yarn install

- name: Build packages
uses: ./.github/actions/build
with:
args: --affected
47 changes: 47 additions & 0 deletions .github/workflows/pr-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Pull Request - Tests

on: pull_request

env:
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }}
TURBO_SCM_HEAD: ${{ github.sha }}

concurrency:
group: push
cancel-in-progress: false

jobs:
test:
name: Test with Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1

- name: Install dependencies
run: |
yarn install

- name: Verify changesets
run: |
yarn changeset status --since=${{ github.event.pull_request.base.sha }}

- name: Test packages
uses: ./.github/actions/test
with:
args: --affected
28 changes: 0 additions & 28 deletions .github/workflows/pr.yaml

This file was deleted.

50 changes: 32 additions & 18 deletions .github/workflows/push.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push
name: Release Packages

on:
workflow_dispatch:
Expand All @@ -9,49 +9,63 @@ on:
default: 'warning'
push:
branches:
- release-1.3
- main
# TODO: Remove once 1.2.x is deprecated
- 1.2.x
- release-[0-9].[0-9]*

concurrency:
group: push
cancel-in-progress: false

jobs:
test:
name: Release
release:
name: Release Packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
# don't persist the GITHUB_TOKEN
# so that semantic-release can use use the generated token
# don't persist the GITHUB_TOKEN so the release can use use the generated token
persist-credentials: false

- name: Test
uses: ./.github/actions/test

- name: Generate token
id: generate-token
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
with:
app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }}
private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }}

- name: Build all packages
uses: ./.github/actions/build

- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Release via semantic-release
<<<<<<< HEAD:.github/workflows/push.yaml
=======
- name: Install dependencies
shell: bash
run: |
yarn install --frozen-lockfile

>>>>>>> a39d9f069 (chore(release): switch from msr to changesets (#2362)):.github/workflows/release.yaml
- name: Build all packages
uses: ./.github/actions/build

- name: Creating .npmrc
run: |
echo -n "Loading tags... ";tagsFound="$(git fetch --tags 2>&1)"; echo "found $(echo "$tagsFound" | wc -l) tags."
npm config set workspaces-update false
yarn release --ignore-private-packages
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to NPM
id: changesets
uses: changesets/action@v1
with:
publish: yarn changeset publish
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_OPTIONS: '--max-old-space-size=8192'
14 changes: 0 additions & 14 deletions .prettierignore

This file was deleted.

Loading