Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

ci: Release from ci #15

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/publish-prerelease.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
versionSpec: "5.1.x"

- name: execute gitversion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]

- 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/[email protected]
with:
files: "${{github.workspace}}/package.json"
patch-syntax: |
= /version => "${{ steps.gitversion.outputs.semVer }}"
= /displayName => "VSIX Viewer"

- name: add version in CHANGELOG.md
uses: cschleiden/[email protected]
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
74 changes: 74 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
versionSpec: "5.1.x"

- name: execute gitversion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]

- 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/[email protected]
with:
files: "${{github.workspace}}/package.json"
patch-syntax: |
= /version => "${{ steps.gitversion.outputs.semVer }}"
= /displayName => "VSIX Viewer"

- name: add version in CHANGELOG.md
uses: cschleiden/[email protected]
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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
1 change: 0 additions & 1 deletion src/features/debugger/macro/macroDebugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down