-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The big refactor. Quantum now is a CLI 🔥 (#22)
* big refactor, becoming a CLI * add some actions, thanks to @JoshuaKGoldberg * move tauri cli to dependencies * more adjustments to file generation * typo on tauri.conf.json * remove debugger logs * bump version * oops... hashbang * add quantum logo * small readme update
- Loading branch information
1 parent
cb2eacc
commit 63760ab
Showing
71 changed files
with
3,740 additions
and
3,661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
description: Prepares the repo for a typical CI job | ||
|
||
name: prepare | ||
|
||
runs: | ||
steps: | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: pnpm | ||
node-version: "20" | ||
- run: pnpm install | ||
shell: bash | ||
using: composite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/prepare | ||
- run: pnpm run test --run | ||
type_check: | ||
name: Type Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/prepare | ||
- run: pnpm tsc | ||
|
||
name: CI | ||
|
||
on: | ||
pull_request: ~ | ||
push: | ||
branches: | ||
- main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,150 +1,28 @@ | ||
name: Publish Release | ||
|
||
on: | ||
push: | ||
branches: | ||
# replace with your release branch, usually `main`. | ||
- example | ||
workflow_dispatch: | ||
inputs: | ||
app-slug: | ||
description: "The slug of your app in your CrabNebula Cloud org" | ||
required: true | ||
default: "quantum" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
APP_CARGO_TOML: src-tauri/Cargo.toml | ||
CN_APP_SLUG: ${{ github.event.inputs.app-slug || 'quantum' }} | ||
group: ${{ github.workflow }} | ||
|
||
jobs: | ||
draft: | ||
release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag_name: ${{ steps.read_version.outputs.value }} | ||
needs_release: ${{ steps.create_tag.outputs.tag_existed != 'true' }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Read version number | ||
uses: SebRollen/toml-action@v1.0.2 | ||
id: read_version | ||
with: | ||
file: ${{ env.APP_CARGO_TOML }} | ||
field: "package.version" | ||
|
||
- name: Create tag | ||
id: create_tag | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const tag = "${{ steps.read_version.outputs.value }}"; | ||
const tagRef = `tags/${tag}`; | ||
const TAG_EXISTED = "tag_existed"; | ||
async function main() { | ||
let tagExisted = true; | ||
try { | ||
await github.rest.git.getRef({ | ||
ref: tagRef, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
tagExisted = true; | ||
core.notice(`Release skipped as tag '${tag}' already exists. Update the version in '${{ env.APP_CARGO_TOML }}' to perform a release.`); | ||
} catch (error) { | ||
if ("status" in error && error.status === 404) tagExisted = false; | ||
else throw error; | ||
} | ||
core.setOutput(TAG_EXISTED, tagExisted); | ||
if (!tagExisted) | ||
await github.rest.git.createRef({ | ||
ref: `refs/${tagRef}`, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
sha: context.sha, | ||
}); | ||
} | ||
main(); | ||
- name: Create draft release | ||
if: ${{ steps.create_tag.outputs.tag_existed != 'true' }} | ||
uses: crabnebula-dev/cloud-release@v0.1.0 | ||
with: | ||
command: release draft ${{ vars.CN_APP_ID }} "${{ steps.read_version.outputs.value }}" --framework tauri | ||
api-key: ${{ secrets.CN_API_KEY }} | ||
|
||
build: | ||
needs: draft | ||
runs-on: ${{ matrix.os }} | ||
if: ${{ needs.draft.outputs.needs_release == 'true' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
settings: | ||
- host: macos-latest | ||
target: x86_64-apple-darwin | ||
- host: macos-latest | ||
target: aarch64-apple-darwin | ||
- host: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
- host: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Install stable toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
cache: false | ||
fetch-depth: 0 | ||
ref: main | ||
- uses: ./.github/actions/prepare | ||
- run: pnpm build | ||
- env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
uses: JoshuaKGoldberg/release-it-action@v0.2.2 | ||
|
||
- name: install Linux dependencies | ||
if: matrix.host == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libwebkit2gtk-4.0-dev webkit2gtk-4.1 | ||
name: 📡 Publish to NPM | ||
|
||
- name: build tauri app | ||
run: | | ||
pnpm install | ||
pnpm run tauri build --ci --target ${{ matrix.settings.target }} | ||
env: | ||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | ||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | ||
|
||
- name: upload assets | ||
uses: crabnebula-dev/cloud-release@v0.1.0 | ||
with: | ||
command: release upload ${{ env.CN_APP_SLUG }} "${{ steps.read_version.outputs.value }}" --framework tauri | ||
api-key: ${{ secrets.CN_API_KEY }} | ||
|
||
publish: | ||
needs: [draft, build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
- name: publish release | ||
uses: crabnebula-dev/cloud-release@v0.1.0 | ||
with: | ||
command: release publish ${{ env.CN_APP_SLUG }} "${{ needs.draft.outputs.tag_name }}" --framework tauri | ||
api-key: ${{ secrets.CN_API_KEY }} | ||
permissions: | ||
contents: write | ||
id-token: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
node_modules | ||
.vinxi | ||
.output | ||
tmp/ | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.15.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"$schema": "https://unpkg.com/release-it@17/schema/release-it.json", | ||
"git": { | ||
"commitMessage": "chore: release v${version}", | ||
"requireCommits": true | ||
}, | ||
"github": { | ||
"autoGenerate": true, | ||
"release": true, | ||
"releaseName": "v${version}" | ||
}, | ||
"npm": { "publishArgs": ["--access public", "--provenance"] }, | ||
"plugins": { | ||
"@release-it/conventional-changelog": { | ||
"infile": "CHANGELOG.md", | ||
"preset": "angular" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,50 @@ | ||
{ | ||
"name": "quantum", | ||
"private": true, | ||
"name": "create-quantum", | ||
"version": "0.0.8", | ||
"type": "module", | ||
"description": "", | ||
"main": "./lib/index.js", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "htttps://github.com/atilafassina/quantum" | ||
}, | ||
"bin": { | ||
"create-quantum": "./bin/run.js" | ||
}, | ||
"files": [ | ||
"bin/", | ||
"package.json", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"start": "vinxi start", | ||
"dev": "vinxi dev", | ||
"build": "vinxi build", | ||
"serve": "vinxi serve", | ||
"tauri": "tauri", | ||
"format": "prettier --write src" | ||
"release-it": "release-it", | ||
"build": "tsup", | ||
"test": "vitest", | ||
"dry": "pnpm build && node ./bin/run.js --debug" | ||
}, | ||
"author": { | ||
"name": "@AtilaFassina", | ||
"url": "https://atila.io" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"@solidjs/router": "^0.13.6", | ||
"@solidjs/start": "^1.0.6", | ||
"@tauri-apps/api": "2.0.0-rc.0", | ||
"@tauri-apps/plugin-shell": "2.0.0-rc.0", | ||
"solid-js": "^1.8.19", | ||
"tailwindcss": "^3.4.7", | ||
"vinxi": "^0.4.0" | ||
"@clack/prompts": "^0.7.0", | ||
"@tauri-apps/cli": "2.0.0-rc.17", | ||
"gradient-string": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@tauri-apps/cli": "2.0.0-rc.0", | ||
"autoprefixer": "^10.4.20", | ||
"internal-ip": "^7.0.0", | ||
"postcss": "^8.4.41", | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-tailwindcss": "^0.5.14", | ||
"@release-it/conventional-changelog": "^8.0.2", | ||
"@types/node": "^22.7.4", | ||
"release-it": "^17.6.0", | ||
"release-it-pnpm": "^4.6.3", | ||
"tsup": "^8.2.4", | ||
"typescript": "^5.5.4", | ||
"vite": "^5.3.5", | ||
"vite-plugin-solid": "^2.10.2" | ||
"vitest": "^2.1.1" | ||
}, | ||
"engines": { | ||
"node": ">=20" | ||
}, | ||
"publishConfig": { | ||
"provenance": "true" | ||
} | ||
} |
Oops, something went wrong.