Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Commit 828448c

Browse files
authored
Merge pull request #11 from agile-ts/master
update
2 parents 95434ee + e96f4e9 commit 828448c

File tree

15 files changed

+219
-233
lines changed

15 files changed

+219
-233
lines changed

.changeset/real-walls-repeat.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/create-release-pr.yaml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.github/workflows/label-pr.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Label Pull Request
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
jobs:
8+
labelPR:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 🔰 Label Pull Request
12+
uses: adamzolyak/monorepo-pr-labeler-action@patching
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-changesets.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 11 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
name: release
1+
name: Release
22
on:
3-
pull_request:
4-
branches:
5-
- master
6-
types: [closed]
3+
push:
4+
branches: [master]
75

86
jobs:
9-
publish:
10-
name: Publish
7+
release:
8+
name: Release
119
runs-on: ubuntu-latest
1210
steps:
13-
14-
# Checkout Project
11+
# Checkout Project
1512
- name: 📚 Checkout
1613
uses: actions/checkout@v2
1714

@@ -25,79 +22,12 @@ jobs:
2522
- name: ⏳ Install
2623
run: yarn install
2724

28-
# Configure Git User so that it can perform Git Actions like commits
29-
- name: 👷 Configure Git User
30-
run: |
31-
git config --global user.name 'bennodev19'
32-
git config --global user.email 'bennodev19@users.noreply.github.com'
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
36-
# Define ${CURRENT_VERSION}
37-
- name: 🔑 Set Current Version
38-
shell: bash -ex {0}
39-
run: |
40-
CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
41-
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
42-
43-
# Check if Tag with the CURRENT_VERSION already exists
44-
- name: Tag Check
45-
id: tag-check
46-
shell: bash -ex {0}
47-
run: |
48-
GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}"
49-
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \
50-
-H "Authorization: token ${GITHUB_TOKEN}")
51-
if [ "$http_status_code" -ne "404" ] ; then
52-
echo "::set-output name=exists_tag::true"
53-
else
54-
echo "::set-output name=exists_tag::false"
55-
fi
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
59-
# Create Git Tag if Tag doesn't already exists
60-
- name: 🏷 Create Git Tag
61-
if: steps.tag-check.outputs.exists_tag == 'false'
62-
uses: azu/action-package-version-to-git-tag@v1
25+
# Create Release Pull Request
26+
- name: 📤 Create Pull Request
27+
uses: changesets/action@master
6328
with:
64-
version: ${{ env.CURRENT_VERSION }}
65-
github_token: ${{ secrets.GITHUB_TOKEN }}
66-
github_repo: ${{ github.repository }}
67-
git_commit_sha: ${{ github.sha }}
68-
git_tag_prefix: "v"
69-
70-
# Create Release
71-
- name: 📝 Create Release
72-
id: create-release
73-
if: steps.tag-check.outputs.exists_tag == 'false' && github.event.pull_request.merged == true
74-
uses: actions/create-release@v1
29+
publish: yarn release
7530
env:
7631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
with:
78-
tag_name: v${{ env.CURRENT_VERSION }}
79-
# Copy Pull Request's tile and body to Release Note
80-
release_name: ${{ github.event.pull_request.title }}
81-
body: |
82-
${{ github.event.pull_request.body }}
83-
draft: false
84-
prerelease: false
32+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
8533

86-
# Publish
87-
- name: 🚀 Publish
88-
if: steps.tag-check.outputs.exists_tag == 'false'
89-
run: |
90-
yarn lerna publish from-package --yes
91-
env:
92-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
94-
- uses: actions/github-script@0.8.0
95-
with:
96-
github-token: ${{secrets.GITHUB_TOKEN}}
97-
script: |
98-
github.issues.createComment({
99-
issue_number: context.issue.number,
100-
owner: context.repo.owner,
101-
repo: context.repo.repo,
102-
body: 'https://github.com/${{ github.repository }}/releases/tag/v${{ env.CURRENT_VERSION }} is released 🎉'
103-
})

.github/workflows/test.yaml renamed to .github/workflows/test-all-packages.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
name: test
1+
name: Test All Packages
22
on:
33
pull_request:
44
branches: ["*"]
5+
types: ["opened", "reopened"]
56

67
jobs:
78
publish:
8-
name: Test
9+
name: Test All Packages
910
runs-on: ubuntu-latest
1011
steps:
1112

@@ -23,6 +24,10 @@ jobs:
2324
- name: ⏳ Install
2425
run: yarn install
2526

26-
# Test All
27+
# Run Tests
2728
- name: 🤔 Test
28-
run: yarn test
29+
run: yarn test
30+
31+
# Build Packages for Testing
32+
- name: 🔨 Build Packages
33+
run: yarn run build

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## 1.0.3 (2020-12-10)
7+
8+
**Note:** Version bump only for package github-actions-test
9+
10+
11+
12+
13+
14+
## 1.0.2 (2020-12-10)
15+
16+
**Note:** Version bump only for package github-actions-test
17+
18+
19+
20+
21+
622
## [1.0.1](https://github.com/agile-ts/agile/compare/v0.0.2...v1.0.1) (2020-12-10)
723

824
**Note:** Version bump only for package github-actions-test

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,45 @@
1-
# agile-github-actions-test
2-
Here I will Test Github Actions for Agile
1+
# Wished Workflow
2+
3+
- **1** Edit Packages in Branch develop
4+
- **2** Create Issue which represent the Version increase
5+
- **3** Enter a comment in the before created issue like '/create release [branch]'
6+
- **3.1** Increases the Version count in the packages that have updated
7+
- **3.2** Creates a new branch from [branch] and creates a Pull Request called after the new Version
8+
- **3.3** Tests the whole Project
9+
- **4** Merge the Pull Request into master
10+
- **4.1** Checks if Tag with a version exists, if so exit
11+
- **4.2** Creates new Releases and Tags called after the version and package that changes
12+
- **4.3** Publishes Packages to npm that version has changed compared on the last release
13+
14+
@agile-ts/core@0.0.1
15+
@agile-ts/multieditor@0.1.8-beta
16+
17+
18+
# Options
19+
20+
## [Changeset][1]
21+
- **1** Edit Packages in Branch develop
22+
- **2** Type Command 'yarn changeset' in the wished [branch]
23+
- **2.1** It does list all branches in the cmd and shows which branches have changed
24+
- **2.2** Select the branches whose version has to be updated
25+
- **2.3** It gives you the option of (major, minor, patch) version bumps
26+
- **2.4** Enter a summary
27+
- **2.5** Confirm selection
28+
- This creates a file in the '.changeset' folder that includes all the changes wished version changes
29+
- **3** Merge the [branch] into the master
30+
- **3.1** Creates a new branch based called 'changesets/release'
31+
- **3.2** Updates the version based on the generated file in '.changeset'
32+
- **3.3** Creates pull request back into the master
33+
- **3.4**
34+
35+
## Custom
36+
TODO
37+
38+
[1]: https://github.com/changesets/action
39+
40+
41+
#### Resources
42+
https://dev.to/stackdumper/setting-up-ci-for-microservices-in-monorepo-using-github-actions-5do2
43+
https://github.community/t/basic-workflow-structure-for-a-monorepo/17093/5
44+
https://github.com/zladovan/monorepo
45+

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"build": "lerna run build",
1010
"watch": "lerna run watch",
1111
"test": "jest",
12+
"release": "lerna run build && changeset publish",
1213
"new-version": "lerna version --conventional-commits --no-git-tag-version --yes",
1314
"dev-publish": "lerna run build && lerna run dev-publish",
1415
"dev-push": "lerna run build && lerna run dev-push",

0 commit comments

Comments
 (0)