Skip to content

Commit

Permalink
Add full CI and Support for linux (#3)
Browse files Browse the repository at this point in the history
* fix: release to tauri branch

* fix: release to tauri branch

* fix: release to tauri branch

* fix: release to tauri

* fix: fix app not loading on linux builds

- update tauri
- fix dist directory path

BREAKING CHANGES

* fix: update readme

* fix: semantic-release

* Update .releaserc

* Update ci.yaml

* fix: Update .releaserc

* fix: remove repo from package.json

* chore(major): 1.0.0-tauri.1 [skip ci]

## 1.0.0-tauri.1 (2023-05-09)

### ⚠ BREAKING CHANGES

* CHANGES

### 🍕 Features

* add setup scripts for setting up tauri dev environment ([0c41a33](0c41a33))
* **dxf:** add support for dimensions in dxf. ([56c884c](56c884c))
* add support for dxf blocks ([xibyte#200](https://github.com/ZanzyTHEbar/jsketcher/issues/200)) ([322d47f](322d47f))
* add support for dxf files import ([2fa2866](2fa2866))
* finish up CI system ([5a688d1](5a688d1))
* initial cir release ([2f94a6e](2f94a6e))
* initial tauri commit ([0a0bb54](0a0bb54))
* update tauri version ([90168da](90168da))

### 🐛 Bug Fixes

* .releasesrc file not having a main branch ([04f2e2c](04f2e2c))
* .releasesrc file not having a main branch ([25ae8a4](25ae8a4))
* **dxf:** add dimLayers to the export. ([xibyte#183](https://github.com/ZanzyTHEbar/jsketcher/issues/183)) ([a3349b5](a3349b5))
* fix app not loading on linux builds ([9ef599d](9ef599d))
* fix release asset types ([8f73410](8f73410))
* release to tauri ([0ba5387](0ba5387))
* release to tauri branch ([11fcf2e](11fcf2e))
* release to tauri branch ([e8486a5](e8486a5))
* release to tauri branch ([6076573](6076573))
* remove caching of pnpm in ci ([96165f3](96165f3))
* remove old path ([f0b426c](f0b426c))
* remove repo from package.json ([dd099b8](dd099b8))
* script for linux ([46bda82](46bda82))
* semantic-release ([3edb4cf](3edb4cf))
* Update .releaserc ([3343d2c](3343d2c))
* update readme ([b00299d](b00299d))
* windows failing to build ([def0782](def0782))

* fix: appimage failing to build

* fix: test ubuntu 18.04

* fix: test ubuntu 18.04

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* feat: update ci to use docker container

* chore(minor): 1.0.0-tauri.2 [skip ci]

## [1.0.0-tauri.2](v1.0.0-tauri.1...v1.0.0-tauri.2) (2023-05-11)

### 🐛 Bug Fixes

* appimage failing to build ([8dc6217](8dc6217))
* test ubuntu 18.04 ([8f55f4d](8f55f4d))
* test ubuntu 18.04 ([0afd146](0afd146))

### 🍕 Features

* update ci to use docker container ([7bcacb0](7bcacb0))
* update ci to use docker container ([98de939](98de939))
* update ci to use docker container ([0750c00](0750c00))
* update ci to use docker container ([715780f](715780f))
* update ci to use docker container ([ccbacdb](ccbacdb))
* update ci to use docker container ([60aa80d](60aa80d))
* update ci to use docker container ([f629258](f629258))
* update ci to use docker container ([278cf82](278cf82))
* update ci to use docker container ([02ec38c](02ec38c))
* update ci to use docker container ([8fb7924](8fb7924))
* update ci to use docker container ([d0493b3](d0493b3))
* update ci to use docker container ([09fbb4f](09fbb4f))
* update ci to use docker container ([c7e39b9](c7e39b9))
* update ci to use docker container ([d9221a7](d9221a7))
* update ci to use docker container ([9e96489](9e96489))
* update ci to use docker container ([765b708](765b708))
* update ci to use docker container ([484b722](484b722))
* update ci to use docker container ([1023d90](1023d90))
* update ci to use docker container ([1d9fd84](1d9fd84))

* feat: update rust deps

* chore(minor): 1.0.0-tauri.3 [skip ci]

## [1.0.0-tauri.3](v1.0.0-tauri.2...v1.0.0-tauri.3) (2023-05-11)

### 🍕 Features

* update rust deps ([b809c28](b809c28))

* fix: wasm not loading in webkit

* chore(patch): 1.0.0-tauri.4 [skip ci]

## [1.0.0-tauri.4](v1.0.0-tauri.3...v1.0.0-tauri.4) (2023-05-11)

### 🐛 Bug Fixes

* wasm not loading in webkit ([0e74582](0e74582))

* feat: add windows binary

* fix: windows ci

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
  • Loading branch information
ZanzyTHEbar and semantic-release-bot authored May 11, 2023
1 parent 6262000 commit e36f11a
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 198 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"env": {
"browser": true,
"commonjs": true,
"node": true,
"es6": true
},
"parser": "@babel/eslint-parser",
Expand Down
93 changes: 53 additions & 40 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- tauri
- feature/tauri
#- master
#- main

Expand Down Expand Up @@ -33,55 +34,79 @@ jobs:
node-version: [18.x]
#, macos-latest
#windows-latest,
platform: [ubuntu-18.04]
platform: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
#- os: windows-latest
# rust_target: x86_64-pc-windows-msvc
#- os: macos-latest
# rust_target: x86_64-apple-darwin
#- os: macos-latest
# rust_target: aarch64-apple-darwin
#- os: ubuntu-18.04
# rust_target: x86_64-unknown-linux-gnu
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
#- os: macos-latest
# rust_target: x86_64-apple-darwin
#- os: macos-latest
# rust_target: aarch64-apple-darwin
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ env.GITHUB_TOKEN }}
- name: Build the App (Linux)
if: matrix.platform == 'ubuntu-latest'
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/zanzythebar/tauridocker:latest
options: -v ${{ github.workspace }}:/workspace
run: |
echo "::group::install node dependencies"
npm install -g pnpm
npm install -g typescript
pnpm install
echo "::group::tauri build"
pnpm tauri build
echo "::endgroup::"
- name: Archive the App (Linux)
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: production-files
path: |
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/appimage/*.AppImage
retention-days: 5
if-no-files-found: error
- name: Verify build (Linux)
if: matrix.platform == 'ubuntu-latest'
run: |
ls -la src-tauri/target/release/bundle/appimage
ls -la src-tauri/target/release/bundle/deb
- name: Node.js setup ${{ matrix.node-version }}
- name: Node.js setup ${{ matrix.node-version }} (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
#cache: "pnpm"
# node-version-file: '.nvmrc'

- name: "Setup Rust"
- name: Setup Rust (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions-rs/toolchain@v1
with:
default: true
override: true
profile: minimal
toolchain: stable
target: ${{ matrix.platform.rust_target }}
- uses: Swatinem/rust-cache@v2

- name: Cache Rust (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: Swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install dependencies (PNPM)
run: |
npm install -g pnpm
npm install -g typescript
pnpm install
- uses: JonasKruckenberg/tauri-build@v1.2.3
- name: Build the app (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: JonasKruckenberg/tauri-build@v1.2.3
id: tauri_build
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
Expand All @@ -94,25 +119,13 @@ jobs:
with:
target: ${{ matrix.platform.rust_target }}

- uses: actions/upload-artifact@v3
- name: Archive the App (Windows & MacOS)
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: production-files
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}"

#- name: Build the app
# uses: tauri-apps/tauri-action@v0
# env:
# GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
# TAURI_PRIVATE_KEY: ${{ env.TAURI_PRIVATE_KEY }}
# TAURI_KEY_PASSWORD: ${{ env.TAURI_KEY_PASSWORD }}
# with:
# # tauri-action replaces \_\_VERSION\_\_ with the app version
# tagName: eyetrackvr-v__VERSION__
# releaseName: "EyeTrackApp v__VERSION__" # name of the release
# releaseBody: "See the assets to download this version and install." # message to include in the release
# releaseDraft: true # set to false to publish the release as a finished product
# prerelease: false # set to true to mark the release as a pre-release

deploy:
runs-on: ubuntu-latest
name: Deploy
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,52 @@
[![semantic versioning](https://img.shields.io/badge/semantic%20versioning-2.0.0-green.svg)](https://semver.org)
> All notable changes to this project will be documented in this file
## [1.0.0-tauri.4](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.3...v1.0.0-tauri.4) (2023-05-11)


### 🐛 Bug Fixes

* wasm not loading in webkit ([0e74582](https://github.com/ZanzyTHEbar/jsketcher/commit/0e7458284831c946c6a0b0b4e4ded96bd4ceffa7))

## [1.0.0-tauri.3](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.2...v1.0.0-tauri.3) (2023-05-11)


### 🍕 Features

* update rust deps ([b809c28](https://github.com/ZanzyTHEbar/jsketcher/commit/b809c28b8cba7a3354cf1f8f8f9917d1f1c9e653))

## [1.0.0-tauri.2](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.1...v1.0.0-tauri.2) (2023-05-11)


### 🐛 Bug Fixes

* appimage failing to build ([8dc6217](https://github.com/ZanzyTHEbar/jsketcher/commit/8dc62170a9be15f1ab1f20d9b7db5f3fa8e371b5))
* test ubuntu 18.04 ([8f55f4d](https://github.com/ZanzyTHEbar/jsketcher/commit/8f55f4d1c1a0bc036441453266c5c5d3ea9c4c65))
* test ubuntu 18.04 ([0afd146](https://github.com/ZanzyTHEbar/jsketcher/commit/0afd14642bb12107622bc39db41417c6f7d23c61))


### 🍕 Features

* update ci to use docker container ([7bcacb0](https://github.com/ZanzyTHEbar/jsketcher/commit/7bcacb0251eb934bd020022433641475782c240e))
* update ci to use docker container ([98de939](https://github.com/ZanzyTHEbar/jsketcher/commit/98de93981f3cb6bda3763a4eb4ce85b201145c78))
* update ci to use docker container ([0750c00](https://github.com/ZanzyTHEbar/jsketcher/commit/0750c006f3f49f5f22205f4a6303e33627ddcbe2))
* update ci to use docker container ([715780f](https://github.com/ZanzyTHEbar/jsketcher/commit/715780f8f6b106b6f1e0e5f19f6145d940aa79ec))
* update ci to use docker container ([ccbacdb](https://github.com/ZanzyTHEbar/jsketcher/commit/ccbacdba32268fb8990d2b5455329014ef04d3ca))
* update ci to use docker container ([60aa80d](https://github.com/ZanzyTHEbar/jsketcher/commit/60aa80d636affd2334526cc4569940cf9ceb77c5))
* update ci to use docker container ([f629258](https://github.com/ZanzyTHEbar/jsketcher/commit/f629258426c7b3a52b4cdce2a120652d3e9727f6))
* update ci to use docker container ([278cf82](https://github.com/ZanzyTHEbar/jsketcher/commit/278cf82ceaae8e76231780ab571e53e8658a3463))
* update ci to use docker container ([02ec38c](https://github.com/ZanzyTHEbar/jsketcher/commit/02ec38c1b7f9ef6b2af5df22ca4b7ae9ceb86151))
* update ci to use docker container ([8fb7924](https://github.com/ZanzyTHEbar/jsketcher/commit/8fb7924dc295aad48f798fd024f8a9394a53d4ba))
* update ci to use docker container ([d0493b3](https://github.com/ZanzyTHEbar/jsketcher/commit/d0493b3e0ca956b2a5ade8c3c2deac0f78b7d16a))
* update ci to use docker container ([09fbb4f](https://github.com/ZanzyTHEbar/jsketcher/commit/09fbb4f9b9b714a013207133963cc5de5934ca3e))
* update ci to use docker container ([c7e39b9](https://github.com/ZanzyTHEbar/jsketcher/commit/c7e39b92f79f6d6d8fa5553e36008eb82f1da8be))
* update ci to use docker container ([d9221a7](https://github.com/ZanzyTHEbar/jsketcher/commit/d9221a77fe581532de86b9f05a198ccca447781a))
* update ci to use docker container ([9e96489](https://github.com/ZanzyTHEbar/jsketcher/commit/9e96489eb762a06f5256a838af90cb6e7035f387))
* update ci to use docker container ([765b708](https://github.com/ZanzyTHEbar/jsketcher/commit/765b708a19fb8fbcb1c2c98395c0570a6b3eef0a))
* update ci to use docker container ([484b722](https://github.com/ZanzyTHEbar/jsketcher/commit/484b722a49be1c8259e93121b6cea5e1b438f865))
* update ci to use docker container ([1023d90](https://github.com/ZanzyTHEbar/jsketcher/commit/1023d905291e6d92dd19f23c1abd031fe2ae242b))
* update ci to use docker container ([1d9fd84](https://github.com/ZanzyTHEbar/jsketcher/commit/1d9fd84aa23984ae9450f940bc2533447ef46d95))

## 1.0.0-tauri.1 (2023-05-09)


Expand Down
39 changes: 20 additions & 19 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const webpackConfig = require('./webpack.config');
const del = require('del');
const libAssets = require("./build/libAssets");
const glob = require("glob");
const {marked} = require("marked");
const { marked } = require("marked");
const Handlebars = require("handlebars");
const exec = require('child_process').exec;

module.exports = function(grunt) {
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');

Expand Down Expand Up @@ -44,11 +44,11 @@ module.exports = function(grunt) {
},

resources: {
expand: true,
cwd: 'web',
src: '**',
dest: 'dist/',
filter: dirFilter(['web/app', 'web/test'])
expand: true,
cwd: 'web',
src: '**',
dest: 'dist/',
filter: dirFilter(['web/app', 'web/test'])
},

docs: {
Expand All @@ -59,12 +59,12 @@ module.exports = function(grunt) {
},
}
});
grunt.registerTask('clean', function() {

grunt.registerTask('clean', function () {
del.sync('dist');
});

grunt.registerTask('build', function() {
grunt.registerTask('build', function () {
const done = this.async();
webpack(webpackConfig, function (error) {
if (error) {
Expand All @@ -75,17 +75,18 @@ module.exports = function(grunt) {
});
});

grunt.registerTask('show-revision', function() {
grunt.registerTask('show-revision', function () {
const done = this.async();
exec('git rev-parse --short HEAD', (err, stdout, stderr) => {
if (process.env.CI_BUILD_REF) exec('git rev-parse --short HEAD', (err, stdout, stderr) => {
grunt.log.writeln(stdout);
done();
});
});

grunt.registerTask('mark-revision', function() {
grunt.registerTask('mark-revision', function () {
const done = this.async();
exec('git rev-parse HEAD > dist/.rev', function (err, stdout, stderr) {

if (process.env.CI_BUILD_REF) exec('git rev-parse HEAD > dist/.rev', function (err, stdout, stderr) {
done(err);
});
});
Expand All @@ -94,7 +95,7 @@ module.exports = function(grunt) {

grunt.registerTask('gen-docs', ['copy:docs', 'process-markdown']);

grunt.registerTask('process-markdown', function() {
grunt.registerTask('process-markdown', function () {
const done = this.async();

const mainTemplate = Handlebars.compile(grunt.file.read("modules/doc/doc-layout.handlebars"));
Expand All @@ -120,7 +121,7 @@ module.exports = function(grunt) {
let link = file.substring(file.indexOf('/') + 1); //drop web prefix
workbench.operations.push({
operationName,
href: '../../../../../../' + convertMdPathToHtml(link)
href: '../../../../../../' + convertMdPathToHtml(link)
});
});

Expand All @@ -138,7 +139,7 @@ module.exports = function(grunt) {

grunt.file.write(dest, htmlContent);

console.log("generated "+ dest);
console.log("generated " + dest);
})
done();
});
Expand All @@ -148,11 +149,11 @@ module.exports = function(grunt) {
};

function convertMdPathToHtml(mdPath) {
return mdPath.substring(0, mdPath.length-('.md'.length)) + '.html';
return mdPath.substring(0, mdPath.length - ('.md'.length)) + '.html';
}

function fixLinks(htmlContent) {
return htmlContent.replace(/href=['"](.+)['"]/g, function(expr, link){
return htmlContent.replace(/href=['"](.+)['"]/g, function (expr, link) {
return 'href="' + convertMdPathToHtml(link) + '"';
});
}
Loading

0 comments on commit e36f11a

Please sign in to comment.