Skip to content

Commit

Permalink
initial ci
Browse files Browse the repository at this point in the history
  • Loading branch information
awnion committed Nov 30, 2023
1 parent daf5f0d commit 747024d
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.json,*.jsonc}]
indent_style = space
indent_size = 4

[{*.yml,*.yaml}]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 8

[Dockerfile]
indent_size = 4

# Ignore paths
[**/{node_modules,target,vendor}/**]
charset = unset
end_of_line = unset
insert_final_newline = unset
indent_size = unset
indent_style = unset
trim_trailing_whitespace = unset
145 changes: 145 additions & 0 deletions .github/workflows/prerelease_wasm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Prerelease WASM

on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: write

env:
release: ${{ startsWith(github.ref, 'refs/tags/') && github.repository == 'gosh-sh/ever-sdk-js' }}

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false

name: Build

env:
CARGO_TERM_COLOR: always
SCCACHE_GHA_VERSION: ${{ vars.SCCACHE_GHA_VERSION || 1 }} # Setting this env var enables the caching
RUSTC_WRAPPER: sccache
CMAKE_C_COMPILER_LAUNCHER: sccache
CMAKE_CXX_COMPILER_LAUNCHER: sccache

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set VERSION
id: version
run: |
echo "VERSION=$(cat version.json | jq -r .version)" >> "$GITHUB_OUTPUT"
- name: Configure sccache
uses: mozilla-actions/sccache-action@v0.0.3

- name: Setup cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: builder-${{ runner.os }}-cargo

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Install Linux tools
env:
packages: >-
build-essential
cmake
curl
clang
run: |
sudo apt update -yq
sudo apt install -yq $packages
- name: Build
working-directory: packages/lib-web/build
env:
CARGO_INCREMENTAL: 0 # important for cache size too
CARGO_NET_RETRY: 10
RUST_BACKTRACE: full
RUSTUP_MAX_RETRIES: 10
run: |
cargo update
cargo run -r
# - name: Artifact ${{ matrix.result }}
# uses: actions/upload-artifact@v3
# with:
# path: ${{ matrix.dir }}/target/${{ matrix.target }}/release/${{ matrix.bin }}
# name: ${{ matrix.result }}--${{ matrix.bin }}
# if-no-files-found: error
# retention-days: 3

# outputs:
# version: ${{ steps.version.outputs.VERSION }}

# release:
# needs:
# - build
# runs-on: ubuntu-latest
# strategy:
# matrix:
# result:
# - git-remote-gosh-darwin-arm64
# - git-remote-gosh-darwin-amd64
# - git-remote-gosh-linux-arm64
# - git-remote-gosh-linux-amd64

# steps:
# - name: Download all artifacts
# uses: actions/download-artifact@v3

# - name: Display structure of downloaded files
# run: ls -R

# ## IMPORTANT! only works with non-windows binaries
# - name: Gather all binaries "${{ matrix.result }}"
# run: |
# mkdir -p ${{ matrix.result }}
# cp ${{ matrix.result }}--*/* ${{ matrix.result }}
# ls -lA ${{ matrix.result }}

# - name: Make archive
# run: |
# chmod +x ${{ matrix.result }}/*
# cd ${{ matrix.result }}
# printf "%s\n" git-remote-gosh_* | sort -rV | tee dispatcher.ini
# tar -czvf ../${{ matrix.result }}.tar.gz .

# - name: Upload Draft
# uses: softprops/action-gh-release@v1
# if: env.release != 'true'
# with:
# draft: true
# tag_name: ${{ github.ref_name }}-${{ github.run_number }}
# files: |
# ${{ matrix.result }}.tar.gz
# body: ""

# - name: Upload Prerelease
# uses: softprops/action-gh-release@v1
# if: env.release == 'true'
# with:
# prerelease: true
# tag_name: ${{ github.ref_name }}
# files: |
# ${{ matrix.result }}.tar.gz
# name: "Version: ${{ github.ref_name }}"
# body: ""


0 comments on commit 747024d

Please sign in to comment.