Skip to content

Commit

Permalink
feat: simplified build based on rustav
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Aug 17, 2023
1 parent 8c20b80 commit e6bae88
Show file tree
Hide file tree
Showing 45 changed files with 2,532 additions and 4,473 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
runs-on:
labels: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: depot/setup-action@v1

- uses: depot/build-push-action@v1
with:
context: .
project: hht03j11d7
outputs: type=local,dest=.
target: binaries
platforms: linux/amd64,linux/arm64

- name: Flatten files
run: mv linux_arm64/* . && mv linux_amd64/* .

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: binaries
path: |
*.node
index.js
index.d.ts
55 changes: 0 additions & 55 deletions .github/workflows/ci.yml

This file was deleted.

61 changes: 12 additions & 49 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ jobs:
runs-on:
labels: ubuntu-latest
permissions:
contents: read
contents: write
id-token: write
packages: write
needs: [ bump-version ]
strategy:
matrix:
platform: [ amd64, arm64 ]
needs: [bump-version]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -56,62 +54,27 @@ jobs:
- name: Set package.json version
run: npm version ${{ needs.bump-version.outputs.version }} --no-git-tag-version

- name: Setup QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/${{ matrix.platform }}

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.platform }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.platform }}-
- name: Build
uses: docker/build-push-action@v4
- uses: depot/setup-action@v1
- uses: depot/build-push-action@v1
with:
context: .
project: hht03j11d7
outputs: type=local,dest=.
target: binaries
platforms: linux/${{ matrix.platform }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache


- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: binaries-${{ matrix.platform }}
path: |
rustav.*.node
release:
name: Release
runs-on:
labels: ubuntu-latest
permissions:
contents: write
packages: write
needs:
- build
- bump-version
steps:
- name: Checkout
uses: actions/checkout@v3
platforms: linux/amd64,linux/arm64

- uses: actions/download-artifact@v3
- name: Flatten files
run: mv linux_arm64/* . && mv linux_amd64/* .

- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
tag_name: ${{ needs.bump-version.outputs.version }}
files: |
**/rustav.*.node
*.node
index.d.ts
index.js
- name: Authenticate to GitHub Packages
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc
Expand Down
200 changes: 196 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,197 @@
.cargo
node_modules
target
# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# End of https://www.toptal.com/developers/gitignore/api/node

# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

# End of https://www.toptal.com/developers/gitignore/api/macos

# Created by https://www.toptal.com/developers/gitignore/api/windows
# Edit at https://www.toptal.com/developers/gitignore?templates=windows

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows

#Added by cargo

/target
Cargo.lock

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

*.node
.vscode
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

5 changes: 0 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@ target
Cargo.lock
.cargo
.github
npm
.eslintrc
.prettierignore
rustfmt.toml
yarn.lock
*.node
Loading

0 comments on commit e6bae88

Please sign in to comment.