Skip to content

Commit

Permalink
fix: Add binaries to publishConfig.executableFiles. (#97)
Browse files Browse the repository at this point in the history
* Test flow.

* Make files exec.

* Test publish.

* Again.

* Remove code.

* Combine release flows.

* Bump versions.

* Remove comment.
  • Loading branch information
milesj authored May 17, 2022
1 parent 328eec5 commit 0a5c50f
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 62 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/release-npm.yml

This file was deleted.

43 changes: 34 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
shell: bash
- name: List packages
run:
ls -R ./packages/cli ./packages/core-linux-* ./packages/core-macos-*
ls -lR ./packages/cli ./packages/core-linux-* ./packages/core-macos-*
./packages/core-windows-*
shell: bash
- name: Test binary
Expand All @@ -153,7 +153,7 @@ jobs:

publish:
if: ${{ github.event_name == 'workflow_dispatch' }}
name: Publish
name: Publish cli/core packages
runs-on: ubuntu-latest
needs:
- test
Expand Down Expand Up @@ -181,25 +181,50 @@ jobs:
path: artifacts
- name: Sync artifact binaries
run: node ./scripts/release/syncArtifacts.mjs
- name: Mark binaries as executable
run: |
chmod +x packages/core-linux-x64-gnu/moon
chmod +x packages/core-macos-x64/moon
chmod +x packages/core-windows-x64-msvc/moon.exe
- name: List binaries
run: ls -lR artifacts
run: ls -lR ./artifacts/release ./packages/core-*
shell: bash
- name: Publish npm packages
run: bash ./scripts/release/publishBinaryPackages.sh
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# TODO changelog
- uses: softprops/action-gh-release@v1
name: Create GitHub release
with:
fail_on_unmatched_files: true
files: artifacts/release/*
tag_name: ${{ env.NPM_TAG_NAME }}
prerelease: ${{ env.NPM_CHANNEL == 'next' }}

publish-npm:
if: ${{ github.event_name == 'workflow_dispatch' }}
name: Publish npm packages
runs-on: ubuntu-latest
env:
NPM_CHANNEL: latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
check-latest: true
node-version: 16
- uses: actions/cache@v3
name: Cache node modules
with:
path: |
~/.yarn
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Build packages
run: yarn run build
- name: Publish npm packages
run: bash ./scripts/release/publishPackages.sh
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions .yarn/versions/40a53572.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@moonrepo/cli": patch
"@moonrepo/core-linux-x64-gnu": patch
"@moonrepo/core-macos-x64": patch
"@moonrepo/core-windows-x64-msvc": patch

declined:
- "@moonrepo/core-linux-x64-musl"
- website
2 changes: 1 addition & 1 deletion packages/cli/moon
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This file exists so that npm/yarn link the binary to `node_modules/.bin`
This file exists so that package manager's link the binary to `node_modules/.bin`!
8 changes: 4 additions & 4 deletions packages/core-linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"libc": [
"glibc"
],
"files": [
"moon"
],
"author": "Miles Johnson",
"license": "MIT",
"repository": {
Expand All @@ -29,6 +26,9 @@
"directory": "packages/core-linux-x64-gnu"
},
"publishConfig": {
"access": "public"
"access": "public",
"executableFiles": [
"moon"
]
}
}
8 changes: 4 additions & 4 deletions packages/core-linux-x64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"libc": [
"musl"
],
"files": [
"moon"
],
"author": "Miles Johnson",
"license": "MIT",
"repository": {
Expand All @@ -29,6 +26,9 @@
"directory": "packages/core-linux-x64-musl"
},
"publishConfig": {
"access": "public"
"access": "public",
"executableFiles": [
"moon"
]
}
}
8 changes: 4 additions & 4 deletions packages/core-macos-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"cpu": [
"x64"
],
"files": [
"moon"
],
"author": "Miles Johnson",
"license": "MIT",
"repository": {
Expand All @@ -26,6 +23,9 @@
"directory": "packages/core-macos-x64"
},
"publishConfig": {
"access": "public"
"access": "public",
"executableFiles": [
"moon"
]
}
}
8 changes: 4 additions & 4 deletions packages/core-windows-x64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"cpu": [
"x64"
],
"files": [
"moon.exe"
],
"author": "Miles Johnson",
"license": "MIT",
"repository": {
Expand All @@ -26,6 +23,9 @@
"directory": "packages/core-windows-x64-msvc"
},
"publishConfig": {
"access": "public"
"access": "public",
"executableFiles": [
"moon.exe"
]
}
}

0 comments on commit 0a5c50f

Please sign in to comment.