diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16121fff..d9ed6e58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,6 +57,8 @@ jobs: mv target/i686-pc-windows-gnu/release/create-o7-app.exe artifacts/create-o7-app-win32.exe mv target/x86_64-apple-darwin/release/create-o7-app artifacts/create-o7-app-macos mv target/aarch64-apple-darwin/release/create-o7-app artifacts/create-o7-app-macos-arm64 + mkdir -p compressed/artifacts + for file in artifacts/*; do tar -czvf "compressed/$file.tar.gz" "$file"; done - name: Get version id: get_version run: echo "version=$(grep "version" Cargo.toml | head -n1 | cut -d '"' -f2)" >> $GITHUB_OUTPUT @@ -64,7 +66,7 @@ jobs: uses: softprops/action-gh-release@v1 with: tag_name: ${{ steps.get_version.outputs.version }} - files: artifacts/* + files: compressed/artifacts/* - name: Install Node.js uses: actions/setup-node@v3 with: diff --git a/pkg/bin.js b/pkg/bin.js index 7f68a74b..7276be78 100644 --- a/pkg/bin.js +++ b/pkg/bin.js @@ -4,24 +4,24 @@ const os = require('os'); const { version } = require('./package.json'); const platforms = [ - { - type: 'Windows_NT', + { + type: 'Windows_NT', arch: 'x64', file: 'win64.exe' - }, - { + }, + { type: 'Windows_NT', arch: 'ia32', file: 'win32.exe' - }, - { - type: 'Linux', - arch: 'x64', + }, + { + type: 'Linux', + arch: 'x64', file: 'linux' }, - { - type: 'Darwin', - arch: 'x64', + { + type: 'Darwin', + arch: 'x64', file: 'macos' }, { @@ -42,9 +42,7 @@ if (!supported) { ); } -module.exports = { - bin: new Binary( - 'create-o7-app', - `https://github.com/ottomated/create-o7-app/releases/download/${version}/create-o7-app-${supported.file}` - ), -}; +module.exports = new Binary( + 'create-o7-app', + `https://github.com/ottomated/create-o7-app/releases/download/${version}/create-o7-app-${supported.file}` +); diff --git a/pkg/install.js b/pkg/install.js index 7946b131..2bfccd07 100644 --- a/pkg/install.js +++ b/pkg/install.js @@ -1,4 +1,2 @@ #!/usr/bin/env node - -const bin = require("./bin"); -bin.install(); +require("./bin").install(); \ No newline at end of file diff --git a/pkg/package.json b/pkg/package.json index 199ceb2e..1dbeb87c 100644 --- a/pkg/package.json +++ b/pkg/package.json @@ -1,6 +1,6 @@ { "name": "create-o7-app", - "version": "TEMPLATE", + "version": "0.1.2", "description": "Create web applications with the o7 stack", "license": "MIT", "repository": { diff --git a/pkg/run.js b/pkg/run.js index 3fee3790..7f633e70 100644 --- a/pkg/run.js +++ b/pkg/run.js @@ -1,4 +1,2 @@ #!/usr/bin/env node - -const bin = require("./bin"); -bin.run(); +require("./bin").run(); \ No newline at end of file