Skip to content

Commit

Permalink
feat: better bundling and install
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyko committed Sep 1, 2022
1 parent a972a89 commit ecb1e37
Show file tree
Hide file tree
Showing 65 changed files with 1,018 additions and 1,528 deletions.
121 changes: 121 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Build binaries for macOS and Linux, publish Node.js packages, create release

on:
push:
tags:
- "v*"

jobs:
build-macos:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup and Package
uses: volta-cli/action@v3
run: |
yarn
yarn run build
yarn prod-install /tmp/tfl
cp -r dist /tmp/tfl
yarn run package:macos
- name: Create tarball
run: |
mv bin/macos/truffle-cli truffle-cli
tar -cvzf truffle-cli-macos-x64.tar.gz truffle-cli
- name: Upload tarball artifact
uses: actions/upload-artifact@v2
with:
name: bin-macos
path: truffle-cli-macos-x64.tar.gz

build-linux:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup and Package
uses: volta-cli/action@v3
run: |
yarn
yarn run build
yarn prod-install /tmp/tfl
cp -r dist /tmp/tfl
yarn run package:linux
- name: Create tarball
run: |
mv bin/linux/truffle-cli truffle-cli
tar -cvzf truffle-cli-linux-x64.tar.gz truffle-cli
- name: Upload tarball artifact
uses: actions/upload-artifact@v2
with:
name: bin-linux
path: truffle-cli-linux-x64.tar.gz

publish-node-packages:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build and publish to NPM
uses: volta-cli/action@v3
with:
registry-url: "https://registry.npmjs.org"
run: |
yarn
yarn run build
yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to Github Packages
uses: volta-cli/action@v3
with:
registry-url: "https://npm.pkg.github.com"
run: npm publish
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

create-release:
needs: [build-macos, build-linux, publish-node-packages]

runs-on: ubuntu-latest

steps:
- name: Download macos tarball
uses: actions/download-artifact@v2
with:
name: bin-macos

- name: Download linux tarball
uses: actions/download-artifact@v2
with:
name: bin-linux

- name: Compute checksums
run: |
sha256sum truffle-cli-macos-x64.tar.gz >> checksums.md
sha256sum truffle-cli-linux-x64.tar.gz >> checksums.md
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: true
body_path: checksums.md
files: |
LICENSE
truffle-cli-macos-x64.tar.gz
truffle-cli-linux-x64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/node_modules
spore.secret.js
dist/
bin/

.yarn/*
!.yarn/releases
Expand Down
199 changes: 199 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-production-install.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ plugins:
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"
- path: .yarn/plugins/@yarnpkg/plugin-production-install.cjs
spec: "https://gitlab.com/Larry1123/yarn-contrib/-/raw/master/packages/plugin-production-install/bundles/@yarnpkg/plugin-production-install.js"

yarnPath: .yarn/releases/yarn-3.2.2.cjs
8 changes: 0 additions & 8 deletions babel.config.cjs

This file was deleted.

65 changes: 0 additions & 65 deletions dist/package.json

This file was deleted.

138 changes: 0 additions & 138 deletions dist/src/cli.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/src/cli.js.map

This file was deleted.

13 changes: 0 additions & 13 deletions dist/src/commands/auth.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/src/commands/auth.js.map

This file was deleted.

Loading

0 comments on commit ecb1e37

Please sign in to comment.