Skip to content

Commit

Permalink
fix: compress rust binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
ottomated committed Mar 4, 2023
1 parent 9a6df90 commit 0c34f0a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ 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
- name: Release Binaries
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:
Expand Down
32 changes: 15 additions & 17 deletions pkg/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},
{
Expand All @@ -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}`
);
4 changes: 1 addition & 3 deletions pkg/install.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env node

const bin = require("./bin");
bin.install();
require("./bin").install();
2 changes: 1 addition & 1 deletion pkg/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 1 addition & 3 deletions pkg/run.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env node

const bin = require("./bin");
bin.run();
require("./bin").run();

0 comments on commit 0c34f0a

Please sign in to comment.