From a76bd77aae3910709602ced85f1001ab57b0eef6 Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:18:54 -0700 Subject: [PATCH 1/9] Create release.yml --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..def4cab --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Generate release + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + DIST_PATH: /tmp/dist + +jobs: + + Release: + if: github.ref == 'refs/heads/main' && startsWith(github.repository, 'belane/') + # needs: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get version + id: get_version + run: | + sudo apt install xmlstarlet + find src -name Directory.Build.props | xargs xmlstarlet sel -N i=http://schemas.microsoft.com/developer/msbuild/2003 -t -v "concat('::set-output name=version::v',//i:VersionPrefix/text())" | xargs echo + + - name: Check tag + id: check_tag + run: curl -s -I ${{ format('https://github.com/{0}/releases/tag/{1}', github.repository, steps.get_version.outputs.version) }} | head -n 1 | cut -d$' ' -f2 | xargs printf "::set-output name=statusCode::%s" | xargs echo + + - name: Publish Release (github) + uses: marvinpinto/action-automatic-releases@latest + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + title: "v${{ github.event.inputs.version }}" + automatic_release_tag: "v${{ github.event.inputs.version }}" + files: ${{ env.DIST_PATH }}/* From 46df13ccb75b1cadb3a4fdd4fe5b8ae5eb8a6b35 Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:23:29 -0700 Subject: [PATCH 2/9] Update and rename release.yml to workflow.yml --- .../workflows/{release.yml => workflow.yml} | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) rename .github/workflows/{release.yml => workflow.yml} (50%) diff --git a/.github/workflows/release.yml b/.github/workflows/workflow.yml similarity index 50% rename from .github/workflows/release.yml rename to .github/workflows/workflow.yml index def4cab..54d136c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/workflow.yml @@ -1,18 +1,14 @@ name: Generate release on: - push: - branches: [ "main" ] pull_request: - branches: [ "main" ] env: DIST_PATH: /tmp/dist jobs: - Release: - if: github.ref == 'refs/heads/main' && startsWith(github.repository, 'belane/') + Compile: # needs: Test runs-on: ubuntu-latest @@ -20,16 +16,25 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Get version - id: get_version - run: | - sudo apt install xmlstarlet - find src -name Directory.Build.props | xargs xmlstarlet sel -N i=http://schemas.microsoft.com/developer/msbuild/2003 -t -v "concat('::set-output name=version::v',//i:VersionPrefix/text())" | xargs echo - - - name: Check tag - id: check_tag - run: curl -s -I ${{ format('https://github.com/{0}/releases/tag/{1}', github.repository, steps.get_version.outputs.version) }} | head -n 1 | cut -d$' ' -f2 | xargs printf "::set-output name=statusCode::%s" | xargs echo + - name: Package VS Code extension + uses: nhedger/package-vscode-extension@main + with: + extensionPath: ${{ env.DIST_PATH }} + Release: + if: github.ref == 'refs/heads/main' && startsWith(github.repository, 'belane/') + needs: Compile + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Package VS Code extension + uses: nhedger/package-vscode-extension@main + with: + extensionPath: ${{ env.DIST_PATH }} + - name: Publish Release (github) uses: marvinpinto/action-automatic-releases@latest with: From ee74b57e54169239f7c8b49106d070148e634d2c Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:24:21 -0700 Subject: [PATCH 3/9] Update workflow.yml --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 54d136c..fe68e43 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,6 +2,7 @@ name: Generate release on: pull_request: + workflow_dispatch: env: DIST_PATH: /tmp/dist From c4d4ca79cae24e3e3dca4629b69cf1f5b50e32cd Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:27:16 -0700 Subject: [PATCH 4/9] Update workflow.yml --- .github/workflows/workflow.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index fe68e43..23ca268 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -20,7 +20,8 @@ jobs: - name: Package VS Code extension uses: nhedger/package-vscode-extension@main with: - extensionPath: ${{ env.DIST_PATH }} + extensionPath: ./src + packagePath: ${{ env.DIST_PATH }} Release: if: github.ref == 'refs/heads/main' && startsWith(github.repository, 'belane/') @@ -34,7 +35,8 @@ jobs: - name: Package VS Code extension uses: nhedger/package-vscode-extension@main with: - extensionPath: ${{ env.DIST_PATH }} + extensionPath: ./src + packagePath: ${{ env.DIST_PATH }} - name: Publish Release (github) uses: marvinpinto/action-automatic-releases@latest From bbd5236675248c07fc10667dc9c6570d1322ab9d Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:28:23 -0700 Subject: [PATCH 5/9] Update workflow.yml --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 23ca268..77103ec 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -20,7 +20,7 @@ jobs: - name: Package VS Code extension uses: nhedger/package-vscode-extension@main with: - extensionPath: ./src + extensionPath: ./ packagePath: ${{ env.DIST_PATH }} Release: @@ -35,7 +35,7 @@ jobs: - name: Package VS Code extension uses: nhedger/package-vscode-extension@main with: - extensionPath: ./src + extensionPath: ./ packagePath: ${{ env.DIST_PATH }} - name: Publish Release (github) From 963897b504affdd3fcebc9d4b5b61aa9b9cb2335 Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:33:24 -0700 Subject: [PATCH 6/9] Update workflow.yml --- .github/workflows/workflow.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 77103ec..42e73f6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -4,9 +4,6 @@ on: pull_request: workflow_dispatch: -env: - DIST_PATH: /tmp/dist - jobs: Compile: @@ -17,11 +14,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Package VS Code extension - uses: nhedger/package-vscode-extension@main - with: - extensionPath: ./ - packagePath: ${{ env.DIST_PATH }} + - name: Prepublish + run: npm run vscode:prepublish + - name: Package + run: npm run package Release: if: github.ref == 'refs/heads/main' && startsWith(github.repository, 'belane/') @@ -32,11 +28,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Package VS Code extension - uses: nhedger/package-vscode-extension@main - with: - extensionPath: ./ - packagePath: ${{ env.DIST_PATH }} + - name: Prepublish + run: npm run vscode:prepublish + - name: Package + run: npm run package - name: Publish Release (github) uses: marvinpinto/action-automatic-releases@latest @@ -45,4 +40,4 @@ jobs: prerelease: false title: "v${{ github.event.inputs.version }}" automatic_release_tag: "v${{ github.event.inputs.version }}" - files: ${{ env.DIST_PATH }}/* + files: /build/* From fd4f649825adb24e63e733c1b4453fbb035beeb6 Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:34:28 -0700 Subject: [PATCH 7/9] Update workflow.yml --- .github/workflows/workflow.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 42e73f6..981c60e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -13,7 +13,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + + - name: Dependences + run: npm i - name: Prepublish run: npm run vscode:prepublish - name: Package @@ -28,6 +30,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Dependences + run: npm i - name: Prepublish run: npm run vscode:prepublish - name: Package From 2e9bc8986ccd99cb791af95c82940b69c8ce9b3b Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:37:52 -0700 Subject: [PATCH 8/9] Update workflow.yml --- .github/workflows/workflow.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 981c60e..ded539e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -27,16 +27,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Dependences - run: npm i - - name: Prepublish - run: npm run vscode:prepublish - - name: Package - run: npm run package - - name: Publish Release (github) uses: marvinpinto/action-automatic-releases@latest with: From 905a0eccf2a7697afdc625d4429bd4e9ee3be970 Mon Sep 17 00:00:00 2001 From: Shargon Date: Fri, 15 Mar 2024 04:45:11 -0700 Subject: [PATCH 9/9] Update workflow.yml --- .github/workflows/workflow.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ded539e..c5aad74 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -7,6 +7,10 @@ on: jobs: Compile: + strategy: + matrix: + node-version: ['20.x'] + # needs: Test runs-on: ubuntu-latest @@ -14,6 +18,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: Dependences run: npm i - name: Prepublish