Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 5965246

Browse files
authored
Merge branch 'develop' into create-pipeline
2 parents e39b3c7 + a3e1c68 commit 5965246

File tree

5 files changed

+1721
-116
lines changed

5 files changed

+1721
-116
lines changed

.changeset/config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@1.4.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"linked": [],
6+
"access": "restricted",
7+
"baseBranch": "master",
8+
"updateInternalDependencies": "patch",
9+
"ignore": []
10+
}

.github/workflows/release.yaml

Lines changed: 14 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
# TODO get inspiration by https://github.com/formium/formik/blob/master/.github/workflows/release.yml
2-
# https://www.christopherbiscardi.com/post/shipping-multipackage-repos-with-github-actions-changesets-and-lerna
3-
4-
name: release
1+
name: Release
52
on:
6-
pull_request:
7-
branches:
8-
- master
9-
types: [closed]
3+
push:
4+
branches: [master]
105

116
jobs:
12-
publish:
13-
name: Publish
14-
runs-on: ubuntu-18.04
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
1510
steps:
16-
17-
# Checkout Project
11+
# Checkout Project
1812
- name: 📚 Checkout
1913
uses: actions/checkout@v2
2014

@@ -28,79 +22,13 @@ jobs:
2822
- name: ⏳ Install
2923
run: yarn install
3024

31-
# Configure Git User so that it can perform Git Actions like commits
32-
- name: 👷 Configure Git User
33-
run: |
34-
git config --global user.name 'bennodev19'
35-
git config --global user.email 'bennodev19@users.noreply.github.com'
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
39-
# Define ${CURRENT_VERSION}
40-
- name: 🔑 Set Current Version
41-
shell: bash -ex {0}
42-
run: |
43-
CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
44-
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
45-
46-
# Check if Tag with the CURRENT_VERSION already exists
47-
- name: Tag Check
48-
id: tag-check
49-
shell: bash -ex {0}
50-
run: |
51-
GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}"
52-
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \
53-
-H "Authorization: token ${GITHUB_TOKEN}")
54-
if [ "$http_status_code" -ne "404" ] ; then
55-
echo "::set-output name=exists_tag::true"
56-
else
57-
echo "::set-output name=exists_tag::false"
58-
fi
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
62-
# Create Git Tag if Tag doesn't already exists
63-
- name: 🏷 Create Git Tag
64-
if: steps.tag-check.outputs.exists_tag == 'false'
65-
uses: azu/action-package-version-to-git-tag@v1
25+
# Create Release Pull Request
26+
- name: 📤 Create Release Pull Request or Publish to NPM
27+
uses: changesets/action@master
6628
with:
67-
version: ${{ env.CURRENT_VERSION }}
68-
github_token: ${{ secrets.GITHUB_TOKEN }}
69-
github_repo: ${{ github.repository }}
70-
git_commit_sha: ${{ github.sha }}
71-
git_tag_prefix: "v"
72-
73-
# Create Release
74-
- name: 📝 Create Release
75-
id: create-release
76-
if: steps.tag-check.outputs.exists_tag == 'false' && github.event.pull_request.merged == true
77-
uses: actions/create-release@v1
29+
publish: yarn release
30+
commit: Version Release
31+
title: Next Release
7832
env:
7933
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
with:
81-
tag_name: v${{ env.CURRENT_VERSION }}
82-
# Copy Pull Request's tile and body to Release Note
83-
release_name: ${{ github.event.pull_request.title }}
84-
body: |
85-
${{ github.event.pull_request.body }}
86-
draft: false
87-
prerelease: false
88-
89-
# Publish
90-
- name: 🚀 Publish
91-
if: steps.tag-check.outputs.exists_tag == 'false'
92-
run: |
93-
yarn lerna publish from-package --yes
94-
env:
95-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
97-
- uses: actions/github-script@0.8.0
98-
with:
99-
github-token: ${{secrets.GITHUB_TOKEN}}
100-
script: |
101-
github.issues.createComment({
102-
issue_number: context.issue.number,
103-
owner: context.repo.owner,
104-
repo: context.repo.repo,
105-
body: 'https://github.com/${{ github.repository }}/releases/tag/v${{ env.CURRENT_VERSION }} is released 🎉'
106-
})
34+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test All Packages
2+
on:
3+
pull_request:
4+
branches: ["*"]
5+
types: ["opened", "reopened"]
6+
7+
jobs:
8+
publish:
9+
name: Test All Packages
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
# Checkout Project
14+
- name: 📚 Checkout
15+
uses: actions/checkout@v2
16+
17+
# Setup NodeJS
18+
- name: 🟢 Setup Node ${{ matrix.node_version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12
22+
23+
# Install Dependencies
24+
- name: ⏳ Install
25+
run: yarn install
26+
27+
# Run Tests
28+
- name: 🤔 Test
29+
run: yarn test
30+
31+
# Build Packages for Testing
32+
- name: 🔨 Build Packages
33+
run: yarn run build:test

0 commit comments

Comments
 (0)