Skip to content

Commit 0a5c50f

Browse files
authored
fix: Add binaries to publishConfig.executableFiles. (#97)
* Test flow. * Make files exec. * Test publish. * Again. * Remove code. * Combine release flows. * Bump versions. * Remove comment.
1 parent 328eec5 commit 0a5c50f

File tree

8 files changed

+60
-62
lines changed

8 files changed

+60
-62
lines changed

.github/workflows/release-npm.yml

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

.github/workflows/release.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
shell: bash
143143
- name: List packages
144144
run:
145-
ls -R ./packages/cli ./packages/core-linux-* ./packages/core-macos-*
145+
ls -lR ./packages/cli ./packages/core-linux-* ./packages/core-macos-*
146146
./packages/core-windows-*
147147
shell: bash
148148
- name: Test binary
@@ -153,7 +153,7 @@ jobs:
153153

154154
publish:
155155
if: ${{ github.event_name == 'workflow_dispatch' }}
156-
name: Publish
156+
name: Publish cli/core packages
157157
runs-on: ubuntu-latest
158158
needs:
159159
- test
@@ -181,25 +181,50 @@ jobs:
181181
path: artifacts
182182
- name: Sync artifact binaries
183183
run: node ./scripts/release/syncArtifacts.mjs
184-
- name: Mark binaries as executable
185-
run: |
186-
chmod +x packages/core-linux-x64-gnu/moon
187-
chmod +x packages/core-macos-x64/moon
188-
chmod +x packages/core-windows-x64-msvc/moon.exe
189184
- name: List binaries
190-
run: ls -lR artifacts
185+
run: ls -lR ./artifacts/release ./packages/core-*
191186
shell: bash
192187
- name: Publish npm packages
193188
run: bash ./scripts/release/publishBinaryPackages.sh
194189
shell: bash
195190
env:
196191
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197192
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
198-
# TODO changelog
199193
- uses: softprops/action-gh-release@v1
200194
name: Create GitHub release
201195
with:
202196
fail_on_unmatched_files: true
203197
files: artifacts/release/*
204198
tag_name: ${{ env.NPM_TAG_NAME }}
205199
prerelease: ${{ env.NPM_CHANNEL == 'next' }}
200+
201+
publish-npm:
202+
if: ${{ github.event_name == 'workflow_dispatch' }}
203+
name: Publish npm packages
204+
runs-on: ubuntu-latest
205+
env:
206+
NPM_CHANNEL: latest
207+
steps:
208+
- uses: actions/checkout@v3
209+
- uses: actions/setup-node@v3
210+
with:
211+
check-latest: true
212+
node-version: 16
213+
- uses: actions/cache@v3
214+
name: Cache node modules
215+
with:
216+
path: |
217+
~/.yarn
218+
.yarn/install-state.gz
219+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
220+
restore-keys: ${{ runner.os }}-yarn-
221+
- name: Install dependencies
222+
run: yarn install --immutable
223+
- name: Build packages
224+
run: yarn run build
225+
- name: Publish npm packages
226+
run: bash ./scripts/release/publishPackages.sh
227+
shell: bash
228+
env:
229+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
230+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.yarn/versions/40a53572.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
releases:
2+
"@moonrepo/cli": patch
3+
"@moonrepo/core-linux-x64-gnu": patch
4+
"@moonrepo/core-macos-x64": patch
5+
"@moonrepo/core-windows-x64-msvc": patch
6+
7+
declined:
8+
- "@moonrepo/core-linux-x64-musl"
9+
- website

packages/cli/moon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This file exists so that npm/yarn link the binary to `node_modules/.bin`
1+
This file exists so that package manager's link the binary to `node_modules/.bin`!

packages/core-linux-x64-gnu/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
"libc": [
1919
"glibc"
2020
],
21-
"files": [
22-
"moon"
23-
],
2421
"author": "Miles Johnson",
2522
"license": "MIT",
2623
"repository": {
@@ -29,6 +26,9 @@
2926
"directory": "packages/core-linux-x64-gnu"
3027
},
3128
"publishConfig": {
32-
"access": "public"
29+
"access": "public",
30+
"executableFiles": [
31+
"moon"
32+
]
3333
}
3434
}

packages/core-linux-x64-musl/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
"libc": [
1919
"musl"
2020
],
21-
"files": [
22-
"moon"
23-
],
2421
"author": "Miles Johnson",
2522
"license": "MIT",
2623
"repository": {
@@ -29,6 +26,9 @@
2926
"directory": "packages/core-linux-x64-musl"
3027
},
3128
"publishConfig": {
32-
"access": "public"
29+
"access": "public",
30+
"executableFiles": [
31+
"moon"
32+
]
3333
}
3434
}

packages/core-macos-x64/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
"cpu": [
1616
"x64"
1717
],
18-
"files": [
19-
"moon"
20-
],
2118
"author": "Miles Johnson",
2219
"license": "MIT",
2320
"repository": {
@@ -26,6 +23,9 @@
2623
"directory": "packages/core-macos-x64"
2724
},
2825
"publishConfig": {
29-
"access": "public"
26+
"access": "public",
27+
"executableFiles": [
28+
"moon"
29+
]
3030
}
3131
}

packages/core-windows-x64-msvc/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
"cpu": [
1616
"x64"
1717
],
18-
"files": [
19-
"moon.exe"
20-
],
2118
"author": "Miles Johnson",
2219
"license": "MIT",
2320
"repository": {
@@ -26,6 +23,9 @@
2623
"directory": "packages/core-windows-x64-msvc"
2724
},
2825
"publishConfig": {
29-
"access": "public"
26+
"access": "public",
27+
"executableFiles": [
28+
"moon.exe"
29+
]
3030
}
3131
}

0 commit comments

Comments
 (0)