Skip to content

Commit

Permalink
MILESTONE: automatic release and onlein publish CI added
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3 committed Apr 17, 2024
1 parent 3e2c4e7 commit e7e4cda
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 169 deletions.
149 changes: 71 additions & 78 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,87 @@
name: PublishScriptSync

# TODO: switch to this one
# on:
# release:
# types: [published]

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]

jobs:
########################### yak ############################
# build_yak:
# runs-on: windows-latest
build_yak:
runs-on: windows-latest

# steps:
# - uses: actions/checkout@v2
steps:
- uses: actions/checkout@v2

# - name: Python setup
# uses: actions/setup-python@v2
# with:
# python-version: '3.x'
- name: Python setup
uses: actions/setup-python@v2
with:
python-version: '3.x'

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install invoke
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install invoke
# # install dotnet for building the RhinoCs plugin
# - name: Install .NET Framework 4.8
# uses: microsoft/[email protected]
# install dotnet for building the RhinoCs plugin
- name: Install .NET Framework 4.8
uses: microsoft/[email protected]

# - name: Run Invoke Yakerizer task
# run: invoke yakerize
- name: Run Invoke Yakerizer task
run: invoke yakerize

# - name: Save artifact
# uses: actions/upload-artifact@v2
# with:
# name: scriptsync_yak_package
# path: yaker\build\*.yak

# publish_yak:
# needs: build_yak
# runs-on: windows-latest

# steps:
# - uses: actions/checkout@v2

# - name: Download artifact
# uses: actions/download-artifact@v2
# with:
# name: scriptsync_yak_package
# path: yaker\build
- name: Save artifact
uses: actions/upload-artifact@v2
with:
name: scriptsync_yak_package
path: yaker\build\*.yak

publish_yak:
needs: build_yak
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: scriptsync_yak_package
path: yaker\build

# # before run this get a token from your local machine with `yak.exe login --ci`
# # # this is a dummy test
# # - name: Publish to Yak test server
# # run: |
# # $YAK_FILE=$(ls *.yak)
# # echo "Yak file: $YAK_FILE"
# # ..\exec\Yak.exe push --source https://test.yak.rhino3d.com $YAK_FILE
# # working-directory: yaker\build
# # env:
# # YAK_TOKEN: ${{ secrets.YAK_IBOIS_TOKEN }}
# # continue-on-error: true
# # # this is also a dummy test
# # - name: Verify the Yak test package
# # run: |
# # ..\exec\Yak.exe search --source https://test.yak.rhino3d.com --all --prerelease script-sync
# # working-directory: yaker\build
# # env:
# # YAK_TOKEN: ${{ secrets.YAK_IBOIS_TOKEN }}
# # real release
# - name: Publish to Yak test server
# run: |
# $YAK_FILE=$(ls *.yak)
# echo "Yak file: $YAK_FILE"
# ..\exec\Yak.exe push $YAK_FILE
# working-directory: yaker\build
# env:
# YAK_TOKEN: ${{ secrets.YAK_IBOIS_TOKEN }}
# # check the real release
# - name: Verify the Yak test package
# run: |
# ..\exec\Yak.exe search --all --prerelease script-sync
# working-directory: yaker\build
# env:
# YAK_TOKEN: ${{ secrets.YAK_IBOIS_TOKEN }}
# before run this get a token from your local machine with `yak.exe login --ci`
# # this is a dummy test
# - name: Publish to Yak test server
# run: |
# $YAK_FILE=$(ls *.yak)
# echo "Yak file: $YAK_FILE"
# ..\exec\Yak.exe push --source https://test.yak.rhino3d.com $YAK_FILE
# working-directory: yaker\build
# env:
# YAK_TOKEN: ${{ secrets.YAK_IBOIS_TOKEN }}
# continue-on-error: true
# # this is also a dummy test
# - name: Verify the Yak test package
# run: |
# ..\exec\Yak.exe search --source https://test.yak.rhino3d.com --all --prerelease script-sync
# working-directory: yaker\build
# env:
# YAK_TOKEN: ${{ secrets.YAK_IBOIS_TOKEN }}
# real release
- name: Publish to Yak test server
run: |
$YAK_FILE=$(ls *.yak)
echo "Yak file: $YAK_FILE"
..\exec\Yak.exe push $YAK_FILE
working-directory: yaker\build
env:
YAK_TOKEN: ${{ secrets.YAK_IBOIS_TOKEN }}
# check the real release
- name: Verify the Yak test package
run: |
..\exec\Yak.exe search --all --prerelease script-sync
working-directory: yaker\build
env:
YAK_TOKEN: ${{ secrets.YAK_IBOIS_TOKEN }}

########################### vsix ############################
build_vsix:
Expand Down
26 changes: 12 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ git clone https://github.com/ibois-epfl/script-sync.git
To build the Rhino plug-in, you need to have RhinoV8 installed on your machine. You can download it from [here](https://www.rhino3d.com/download/rhino-for-windows/8/latest).
Be sure that dotnet is installed on your machine. You can download it from [here](https://dotnet.microsoft.com/download/dotnet/5.0).

### Build the Rhino plug-in
Checkout the folder containing the Rhino plug-in.
```terminal
cd .\CsRhino\
Expand All @@ -26,21 +25,20 @@ dotnet build
The plug-in is built in the folder `.\CsRhino\bin\`.
To test it remove all versions of the plug-in from RhinoV8 and drag-and-drop the `.rhp` file in RhinoV8. No need to redo it after each build, it will be updated if you close and reopen RhinoV8.

## For VSCode extension
To build the the VSCode extension, you need to have VSCode installed on your machine. You can download it from [here](https://code.visualstudio.com/download).
Be sure that nodejs is installed on your machine. You can download it from [here](https://nodejs.org/en/download/).
Also `vsce` needs to be installed on your machine. You can install it by running the following command in the terminal.
## Build the VSCode extension
Run the python invoke:
```terminal
npm install -g vsce
invoke vscerize
```
The `.vsix` file is created in `VSCode/scriptsync/`. You can install it in VSCode by dragging-and-dropping it in the Extensions panel.

### Build the VSCode extension
Checkout the folder containing the VSCode extension.
## Build the YAK package
Be sure to update the correct number version in the `manifest.yml` file in root.
Next call the python task:
```terminal
cd .\VSCode\scriptsync\
invoke yakerize
```
Do modifications to the code and build the extension. The main file is `extension.ts` and additional info or variables can be found in `package.json`.
```terminal
vsce package
```
A new `.vsix` file is created in the folder. To test it, open VSCode and install the extension from the `.vsix` file. To do so, open the extensions panel, click on the three dots on the top right corner and select `Install from VSIX...`. Select the `.vsix` file and reload VSCode. Otherwise you can right-click the `.vsix` file and select `Install..`. Reload VSCode.
This will create a `.yak` file in the root folder. You can install it in RhinoV8 by dragging-and-dropping it in RhinoV8.

## Release
The `.yak` and `.vsix` will be generated and published online when a release is created on GitHub. The version number is the same as the one in the `manifest.yml` file.
76 changes: 0 additions & 76 deletions RELEASE.md

This file was deleted.

2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: script-sync
version: 1.1.6
version: 1.1.7
authors:
- Andrea Settimi
description: Script-sync is a Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8.
Expand Down

0 comments on commit e7e4cda

Please sign in to comment.