From f4a8059bcd8cce35bcde8067bb0d75aaa110124d Mon Sep 17 00:00:00 2001 From: Cheethas <47148561+cheethas@users.noreply.github.com> Date: Sun, 17 Jul 2022 21:43:07 +0100 Subject: [PATCH 1/2] :construction_worker: Add pre-release deployment workflow --- .github/workflows/publish-release.yaml | 87 ++++++++++++++++++++ package.json | 4 +- src/features/debugger/macro/macroDebugger.js | 1 - 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-release.yaml diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml new file mode 100644 index 0000000..65bbc7b --- /dev/null +++ b/.github/workflows/publish-release.yaml @@ -0,0 +1,87 @@ +# Run on master and feature branches +on: + push: + branches: + - "feature/**" + - 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 }} + release_name: v${{ steps.gitversion.outputs.semVer }} \ No newline at end of file diff --git a/package.json b/package.json index ef2e01f..be5c482 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", + "publish:prerelease": "vsce publish --pre-release", + "publish: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) { From eb3490054325bedf281c8e6210d94331843fd574 Mon Sep 17 00:00:00 2001 From: Cheethas <47148561+cheethas@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:08:22 +0100 Subject: [PATCH 2/2] ci: Add ci workflows for release and pre-release --- .github/workflows/publish-prerelease.yaml | 85 +++++++++++++++++++++++ .github/workflows/publish-release.yaml | 39 ++++------- package.json | 4 +- 3 files changed, 100 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/publish-prerelease.yaml 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 index 65bbc7b..e2959e2 100644 --- a/.github/workflows/publish-release.yaml +++ b/.github/workflows/publish-release.yaml @@ -1,11 +1,8 @@ -# Run on master and feature branches -on: +# Run when a release is cut +on: push: - branches: - - "feature/**" - - master - paths-ignore: - - '.vscode/**' + tags: + - "v[0-9]+.[0-9]+.[0-9]+" jobs: publish: @@ -21,12 +18,12 @@ jobs: - name: install gitversion tool uses: gittools/actions/gitversion/setup@v0.9 with: - versionSpec: '5.1.x' - + 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 }}" @@ -38,23 +35,23 @@ jobs: - name: setup node uses: actions/setup-node@v1 with: - node-version: '12.x' - + 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' + 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' + files: "${{github.workspace}}/CHANGELOG.md" env: VERSION: "${{ steps.gitversion.outputs.semVer }}" @@ -74,14 +71,4 @@ jobs: # 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 }} - release_name: v${{ steps.gitversion.outputs.semVer }} \ No newline at end of file + run: npm run deploy:release diff --git a/package.json b/package.json index be5c482..560219d 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "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", - "publish:prerelease": "vsce publish --pre-release", - "publish:release": "vsce publish" + "deploy:prerelease": "vsce publish --pre-release", + "deploy:release": "vsce publish" }, "main": "./src/extension.js", "extensionKind": [