diff --git a/.github/workflows/publish-prerelease.yaml b/.github/workflows/publish-prerelease.yaml new file mode 100644 index 0000000..1c570d2 --- /dev/null +++ b/.github/workflows/publish-prerelease.yaml @@ -0,0 +1,85 @@ +# Run on master and feature branches +on: + push: + branches: + - master + paths-ignore: + - ".vscode/**" + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + steps: + - name: checkout repo + uses: actions/checkout@v2 + + - name: fetch all history and tags from all branches for gitversion + run: git fetch --prune --unshallow + + - name: install gitversion tool + uses: gittools/actions/gitversion/setup@v0.9 + with: + versionSpec: "5.1.x" + + - name: execute gitversion + id: gitversion # step id used as reference for output values + uses: gittools/actions/gitversion/execute@v0.9 + + - name: print gitversion + run: | + echo "Major: ${{ steps.gitversion.outputs.major }}" + echo "Minor: ${{ steps.gitversion.outputs.minor }}" + echo "Patch: ${{ steps.gitversion.outputs.patch }}" + echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" + echo "SemVer: ${{ steps.gitversion.outputs.semVer }}" + + - name: setup node + uses: actions/setup-node@v1 + with: + node-version: "12.x" + + - name: clean install dependencies + run: npm ci + + - name: update metadata in package.json + uses: onlyutkarsh/patch-files-action@v1.0.1 + with: + files: "${{github.workspace}}/package.json" + patch-syntax: | + = /version => "${{ steps.gitversion.outputs.semVer }}" + = /displayName => "VSIX Viewer" + + - name: add version in CHANGELOG.md + uses: cschleiden/replace-tokens@v1.0 + with: + files: "${{github.workspace}}/CHANGELOG.md" + env: + VERSION: "${{ steps.gitversion.outputs.semVer }}" + + - name: compile and create vsix + run: npm run package + + - name: print vsix path + run: | + echo "VSIX Path: ${{ env.vsix_path }}" + + - name: upload vsix as artifact + uses: actions/upload-artifact@v1 + with: + name: vsix-viewer-${{steps.gitversion.outputs.semVer}}.vsix + path: ${{github.workspace}}/vsix-viewer-${{steps.gitversion.outputs.semVer}}.vsix + + # Only publish on master branch + - name: Publish pre-release + if: github.ref == 'refs/heads/master' + run: npm run deploy:prerelease + + - name: Create a release + if: github.ref == 'refs/heads/master' + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.gitversion.outputs.semVer }}-rc + release_name: v${{ steps.gitversion.outputs.semVer }}-rc diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml new file mode 100644 index 0000000..e2959e2 --- /dev/null +++ b/.github/workflows/publish-release.yaml @@ -0,0 +1,74 @@ +# Run when a release is cut +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + steps: + - name: checkout repo + uses: actions/checkout@v2 + + - name: fetch all history and tags from all branches for gitversion + run: git fetch --prune --unshallow + + - name: install gitversion tool + uses: gittools/actions/gitversion/setup@v0.9 + with: + versionSpec: "5.1.x" + + - name: execute gitversion + id: gitversion # step id used as reference for output values + uses: gittools/actions/gitversion/execute@v0.9 + + - name: print gitversion + run: | + echo "Major: ${{ steps.gitversion.outputs.major }}" + echo "Minor: ${{ steps.gitversion.outputs.minor }}" + echo "Patch: ${{ steps.gitversion.outputs.patch }}" + echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" + echo "SemVer: ${{ steps.gitversion.outputs.semVer }}" + + - name: setup node + uses: actions/setup-node@v1 + with: + node-version: "12.x" + + - name: clean install dependencies + run: npm ci + + - name: update metadata in package.json + uses: onlyutkarsh/patch-files-action@v1.0.1 + with: + files: "${{github.workspace}}/package.json" + patch-syntax: | + = /version => "${{ steps.gitversion.outputs.semVer }}" + = /displayName => "VSIX Viewer" + + - name: add version in CHANGELOG.md + uses: cschleiden/replace-tokens@v1.0 + with: + files: "${{github.workspace}}/CHANGELOG.md" + env: + VERSION: "${{ steps.gitversion.outputs.semVer }}" + + - name: compile and create vsix + run: npm run package + + - name: print vsix path + run: | + echo "VSIX Path: ${{ env.vsix_path }}" + + - name: upload vsix as artifact + uses: actions/upload-artifact@v1 + with: + name: vsix-viewer-${{steps.gitversion.outputs.semVer}}.vsix + path: ${{github.workspace}}/vsix-viewer-${{steps.gitversion.outputs.semVer}}.vsix + + # Only publish on master branch + - name: Publish pre-release + if: github.ref == 'refs/heads/master' + run: npm run deploy:release diff --git a/package.json b/package.json index ef2e01f..560219d 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,9 @@ "vscode:prepublish": "npm run esbuild-base -- --minify", "esbuild-base": "esbuild ./src/extension.js --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node", "esbuild": "npm run esbuild-base -- --sourcemap", - "esbuild-watch": "npm run esbuild-base -- --sourcemap --watch" + "esbuild-watch": "npm run esbuild-base -- --sourcemap --watch", + "deploy:prerelease": "vsce publish --pre-release", + "deploy:release": "vsce publish" }, "main": "./src/extension.js", "extensionKind": [ diff --git a/src/features/debugger/macro/macroDebugger.js b/src/features/debugger/macro/macroDebugger.js index c794357..036b2eb 100644 --- a/src/features/debugger/macro/macroDebugger.js +++ b/src/features/debugger/macro/macroDebugger.js @@ -93,7 +93,6 @@ function createCompiledMacro(cwd, macro, argsObject, currentFile, imports) { macroBody += "error:\n\t0x0 dup1 stop"; } - // //#include "../${currentFile}" - was the top line - do i need it if not compiling from files? const compilableMacro = ` ${files.join("\n")} #define macro MAIN() = takes(0) returns (0) {