diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml deleted file mode 100644 index 9e4c015d839..00000000000 --- a/.github/workflows/release-npm.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Release - -on: - # Manually release packages - workflow_dispatch: - -jobs: - publish: - name: Publish - 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83d3a97c6ce..4c2cc032e03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -181,13 +181,8 @@ 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 @@ -195,7 +190,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # TODO changelog - uses: softprops/action-gh-release@v1 name: Create GitHub release with: @@ -203,3 +197,34 @@ jobs: 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 }} diff --git a/.yarn/versions/40a53572.yml b/.yarn/versions/40a53572.yml new file mode 100644 index 00000000000..e7c5dda6879 --- /dev/null +++ b/.yarn/versions/40a53572.yml @@ -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 diff --git a/packages/cli/moon b/packages/cli/moon index a79704bb8c2..d442913b790 100755 --- a/packages/cli/moon +++ b/packages/cli/moon @@ -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`! diff --git a/packages/core-linux-x64-gnu/package.json b/packages/core-linux-x64-gnu/package.json index e8eb0cdf384..f39119402d4 100644 --- a/packages/core-linux-x64-gnu/package.json +++ b/packages/core-linux-x64-gnu/package.json @@ -18,9 +18,6 @@ "libc": [ "glibc" ], - "files": [ - "moon" - ], "author": "Miles Johnson", "license": "MIT", "repository": { @@ -29,6 +26,9 @@ "directory": "packages/core-linux-x64-gnu" }, "publishConfig": { - "access": "public" + "access": "public", + "executableFiles": [ + "moon" + ] } } diff --git a/packages/core-linux-x64-musl/package.json b/packages/core-linux-x64-musl/package.json index d1aef5c8bff..d459696c3db 100644 --- a/packages/core-linux-x64-musl/package.json +++ b/packages/core-linux-x64-musl/package.json @@ -18,9 +18,6 @@ "libc": [ "musl" ], - "files": [ - "moon" - ], "author": "Miles Johnson", "license": "MIT", "repository": { @@ -29,6 +26,9 @@ "directory": "packages/core-linux-x64-musl" }, "publishConfig": { - "access": "public" + "access": "public", + "executableFiles": [ + "moon" + ] } } diff --git a/packages/core-macos-x64/package.json b/packages/core-macos-x64/package.json index 25c2ef7acf3..ef5ce6bd40e 100644 --- a/packages/core-macos-x64/package.json +++ b/packages/core-macos-x64/package.json @@ -15,9 +15,6 @@ "cpu": [ "x64" ], - "files": [ - "moon" - ], "author": "Miles Johnson", "license": "MIT", "repository": { @@ -26,6 +23,9 @@ "directory": "packages/core-macos-x64" }, "publishConfig": { - "access": "public" + "access": "public", + "executableFiles": [ + "moon" + ] } } diff --git a/packages/core-windows-x64-msvc/package.json b/packages/core-windows-x64-msvc/package.json index dcbc1dfcb14..0a83038f1d8 100644 --- a/packages/core-windows-x64-msvc/package.json +++ b/packages/core-windows-x64-msvc/package.json @@ -15,9 +15,6 @@ "cpu": [ "x64" ], - "files": [ - "moon.exe" - ], "author": "Miles Johnson", "license": "MIT", "repository": { @@ -26,6 +23,9 @@ "directory": "packages/core-windows-x64-msvc" }, "publishConfig": { - "access": "public" + "access": "public", + "executableFiles": [ + "moon.exe" + ] } }