Skip to content

Commit

Permalink
fix(action): pack action (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
baked-dev authored Jul 4, 2024
1 parent 9c97459 commit 94933b0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 48 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,12 @@ concurrency:
cancel-in-progress: true

jobs:
unimported:
name: Check unimported
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: whopio/[email protected]
with:
token: ${{ github.token }}
projects: "packages/action,packages/create-turbo-module,packages/turbo-module"

install:
name: Install node modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.15.5
- uses: pnpm/action-setup@v4
- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -41,16 +29,14 @@ jobs:
cache: pnpm
- name: Install all packages
run: pnpm install

lint:
name: Lint repository
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.15.5
- uses: pnpm/action-setup@v4
- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -68,9 +54,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.15.5
- uses: pnpm/action-setup@v4
- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -88,9 +72,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.15.5
- uses: pnpm/action-setup@v4
- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -101,4 +83,3 @@ jobs:
run: pnpm install
- name: Build packages
run: pnpm turbo test

7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ concurrency:
group: "release"
cancel-in-progress: false

permissions:
pull-requests: write

jobs:
release:
name: Publish to npm and release on github
Expand All @@ -25,9 +28,7 @@ jobs:
with:
action: check
token: ${{ github.token }}
- uses: pnpm/action-setup@v2
with:
version: 8.15.5
- uses: pnpm/action-setup@v4
if: steps.check.outputs.can-publish == 'true'
- name: Setup node
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"node": ">=18.0.0"
},
"dependencies": {},
"packageManager": "pnpm@8.5.15"
"packageManager": "pnpm@8.15.8"
}
9 changes: 8 additions & 1 deletion packages/action/out/767.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1318,8 +1318,11 @@ var capitalise = function(str) {
var _str_at;
return "".concat(((_str_at = str.at(0)) === null || _str_at === void 0 ? void 0 : _str_at.toUpperCase()) || "").concat(str.slice(1));
};
// GitHub enforces a max length of 65536 characters for a pull request body
var maxLength = 65536;
var lengthBuffer = 1000;
var makeGithubReleaseMessage = function(stats) {
return "\n".concat(Object.entries(stats.pulls).map(function(param) {
var message = "\n".concat(Object.entries(stats.pulls).map(function(param) {
var _param = get_message_slicedToArray(param, 2), key = _param[0], pulls = _param[1];
return "\n### ".concat(capitalise(key), " Changes\n\n").concat(pulls.map(function(param) {
var title = param.title;
Expand All @@ -1328,6 +1331,10 @@ var makeGithubReleaseMessage = function(stats) {
}).join(""), "\n### Credits\n").concat(Array.from(stats.authors).map(function(author) {
return "@".concat(author);
}).join(", "), "\n").trim();
if (message.length >= maxLength - lengthBuffer) {
return "".concat(message.slice(0, maxLength - lengthBuffer), "...\nThis message has been truncated to avoid exceeding the GitHub API's body limit.");
}
return message;
};
var getReleaseMessage = function() {
var _ref = get_message_asyncToGenerator(function(prerelease) {
Expand Down
18 changes: 4 additions & 14 deletions packages/create-turbo-module/template/.github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,12 @@ concurrency:
cancel-in-progress: true

jobs:
unimported:
name: Check unimported
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: whopio/[email protected]
with:
token: ${{ github.token }}
projects: "packages/$$NAME"

install:
name: Install node modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 7.13.6
- name: Setup node
Expand All @@ -44,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 7.13.6
- name: Setup node
Expand All @@ -64,7 +54,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 7.13.6
- name: Setup node
Expand All @@ -84,7 +74,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 7.13.6
- name: Setup node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
name: Build, test, release

concurrency:
group: "release"
group: 'release'
cancel-in-progress: false

jobs:
Expand All @@ -20,12 +20,12 @@ jobs:
- name: Check package.json for version increase
id: check
uses: whopio/turbo-module@v$$VERSION
with:
with:
action: check
token: ${{ github.token }}
- uses: actions/checkout@v3
if: steps.check.outputs.can-publish == 'true'
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 7.13.6
if: steps.check.outputs.can-publish == 'true'
Expand All @@ -49,14 +49,14 @@ jobs:
- name: Github Release
id: release
uses: whopio/turbo-module@v$$VERSION
with:
with:
action: release
token: ${{ github.token }}
version: ${{ steps.check.outputs.version }}
if: steps.check.outputs.can-publish == 'true'
- name: Sync auto-release PRs
uses: whopio/turbo-module@v$$VERSION
with:
with:
action: sync
token: ${{ github.token }}
published: ${{ steps.release.outputs.published }}

0 comments on commit 94933b0

Please sign in to comment.