Skip to content

Commit

Permalink
Merge branch 'main' into feat/updater
Browse files Browse the repository at this point in the history
  • Loading branch information
amr-crabnebula committed Nov 17, 2023
2 parents 9580f41 + fd13423 commit f6454e4
Show file tree
Hide file tree
Showing 74 changed files with 7,770 additions and 695 deletions.
5 changes: 5 additions & 0 deletions .changes/appimage-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-packager": minor
---

Added `files` configuration under `AppImageConfig` for adding custom files on the AppImage's AppDir.
5 changes: 5 additions & 0 deletions .changes/binary-path-breaking-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-packager": minor
---

Renamed binary `filename` property to `path`, which supports absolute paths.
66 changes: 66 additions & 0 deletions .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,64 @@
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f",
"git push --tags -f"
]
},
"javascript": {
"version": true,
"getPublishedVersion": {
"use": "fetch:check",
"options": {
"url": "https://registry.npmjs.com/${ pkg.pkg }/${ pkg.pkgFile.version }"
}
},
"prepublish": [
{
"command": "pnpm install",
"dryRunCommand": true
},
{
"command": "echo '<details>\n<summary><em><h4>PNPM Audit</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "pnpm audit",
"dryRunCommand": true,
"runFromRoot": true,
"pipe": true
},
{
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "npm pack",
"dryRunCommand": true
}
],
"publish": [
"sleep 15s",
{
"command": "echo '<details>\n<summary><em><h4>PNPM Publish</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "pnpm publish --access public",
"dryRunCommand": "npm publish --dry-run --access public",
"pipe": true
},
{
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
}
],
"postpublish": [
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f",
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f",
"git push --tags -f"
]
}
},
"packages": {
Expand All @@ -44,6 +102,14 @@
"name": "${ pkg.pkg }-${ pkgFile.version }.crate"
}
]
},
"@crabnebula/packager": {
"path": "./bindings/packager/nodejs",
"manager": "javascript",
"dependencies": ["cargo-packager"],
"prepublish": [],
"publish": [],
"postpublish": []
}
}
}
5 changes: 5 additions & 0 deletions .changes/packager-nodejs-initial-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crabnebula/packager": minor
---

Initial release.
64 changes: 64 additions & 0 deletions .github/workflows/check-packager-binding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test `@crabnebula/packager`

on:
push:
branches:
- main
paths:
- ".github/workflows/check-packager-binding.yml"
- "crates/packager/**"
- "bindings/packager/nodejs/**"
pull_request:
branches:
- main
paths:
- ".github/workflows/check-packager-binding.yml"
- "crates/packager/**"
- "bindings/packager/nodejs/**"

env:
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.platform }}

strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.4

- name: setup node
uses: actions/setup-node@v2
with:
node-version: 18
cache: pnpm
cache-dependency-path: bindings/packager/nodejs/pnpm-lock.yaml

- uses: Swatinem/rust-cache@v2
with:
workspaces: crates/packager

- name: test
timeout-minutes: 30
run: |
cd bindings/packager/nodejs
pnpm install
pnpm build
pnpm test
22 changes: 22 additions & 0 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,25 @@ jobs:
commit-message: "release: apply version updates from current changes"
labels: "version updates"
body: ${{ steps.covector.outputs.change }}

- name: Get `@crabnebula/packager` release id
uses: actions/github-script@v6
id: cliReleaseId
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, '@crabnebula/packager')
with:
result-encoding: string
script: |
const output = `${{ toJSON(steps.covector.outputs) }}`;
const [_, id] = /"-crabnebula-packager-releaseId": "([0-9]+)"/g.exec(output);
return id;
- name: Trigger `@crabnebula/packager` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, '@crabnebula/packager')
uses: peter-evans/repository-dispatch@v1
with:
event-type: publish-packager-nodejs
client-payload: '{"releaseId": "${{ steps.cliReleaseId.outputs.result }}" }'
Loading

0 comments on commit f6454e4

Please sign in to comment.