diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b06f830..3ab4850 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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/setup-msbuild@v1.0.2 + # install dotnet for building the RhinoCs plugin + - name: Install .NET Framework 4.8 + uses: microsoft/setup-msbuild@v1.0.2 - # - 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: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d19feb..3d79e1d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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\ @@ -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. \ No newline at end of file +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. diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index ea598b0..0000000 --- a/RELEASE.md +++ /dev/null @@ -1,76 +0,0 @@ -# Guide for releasing a new version of the package (for code maintainers) - ---- -## For Rhino plug-in -Script-sync is released as a `.yak` package via the Yak executable provided by McNeel. - -### Build the Rhino plug-in -Start by building the Rhino plug-in as described in the [contribution guideline](#contribution-guideline). OR, grab the latest version of the plug-in from the artifacts of the latest successful build on the latest e.g., [CI](https://github.com/ibois-epfl/script-sync/actions/runs/7349030258). - -### Create the `.yak` package -Create a folder with the following structure: -``` -script_sync-1.0.2-rh8-win/ -├───logo.png <--64x64px -├───ScriptSync.rhp -├─── -├───manifest.yml -└───misc/ - ├───LICENSE.md - └───README.md -``` -The `manifest.yml` file should look like this: -```yml -name: script-sync -version: 1.**1**.0 -authors: - - Andrea Settimi -description: Script-sync is a Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8 and Grasshopper. -url: https://github.com/ibois-epfl/script-sync -keywords: - - Rhino - - Cs - - Python - - IronPython - - CPython - - VScode - - Utility -icon: logo.png -``` -Now, create the `.yak` package by running the following command in the terminal: -```terminal -yak build -``` -The `.yak` package is created in the folder `script_sync-1.0.2-rh8-win.yak`. - -### Publish the `.yak` package to the Yak server - -To upload the package to the Yak server, run the following command in the terminal: -```terminal -yak login -yak push script_sync-1.0.2-rh8-win.yak -``` ---- - -## For VSCode extension -Script-sync is released as a `.vsix` package via the VSCE executable provided by Microsoft. - -### Build the VSCode extension -Start by building the VSCode extension as described in the [contribution guideline](#contribution-guideline). OR, grab the latest version of the extension from the artifacts of the latest successful build on the latest e.g., [CI](https://github.com/ibois-epfl/script-sync/actions/runs/7349030262). - -Make sure to change the correct version number in the `package.json` file. -```json - "version": "1.1.4", - "engines": { - "vscode": "^1.85.0" - }, -``` - -### Publish the `.vsix` package to the VSCode marketplace -To upload the package to the VSCode marketplace, run the following command in the terminal in the folder containing the `.vsix` file: -```terminal -vsce login ibois-epfl -vsce publish -``` - - diff --git a/manifest.yml b/manifest.yml index a78a393..60f9781 100644 --- a/manifest.yml +++ b/manifest.yml @@ -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.