From bbdc16cdd496a5d42e111c830f0c6559723c118d Mon Sep 17 00:00:00 2001 From: Alvaro Saurin Date: Mon, 7 Dec 2020 00:09:47 +0100 Subject: [PATCH] 0.0.1 --- .github/workflows/publish.yml | 45 +++++++++++++++++++++++++++++++---- package-lock.json | 2 +- package.json | 4 +--- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7bb6787..44db2a4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,27 +10,61 @@ jobs: name: Create and Upload Release runs-on: ubuntu-latest steps: + + - name: Build info + id: info + run: | + echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} + echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} + echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} + - name: Checkout code uses: actions/checkout@v2 + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://npm.pkg.github.com/ + + - run: npm install + - run: npm test + + # - name: Authenticate against GitHub package registry + # run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc + + - name: Setup GIT + run: | + git switch -c main + git config --global user.email "alvaro.saurin@gmail.com" + git config --global user.name "Alvaro Saurin" + - name: Set release version - run: npm version ${{ github.ref }} + run: npm version --allow-same-version ${{ steps.info.outputs.SOURCE_TAG }} - name: Create package project uses: lannonbr/vsce-action@master with: - args: "package -o vscode-k3d-${{ github.ref }}.vsix" + args: "package -o vscode-k3d-${{ steps.info.outputs.SOURCE_TAG }}.vsix" env: VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }} + - name: Changelog + uses: scottbrenner/generate-changelog-action@master + id: changelog + env: + REPO: ${{ github.repository }} + - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + tag_name: ${{ steps.info.outputs.SOURCE_TAG }} + release_name: Release ${{ steps.info.outputs.SOURCE_TAG }} + body: | + ${{ steps.changelog.outputs.changelog }} draft: false prerelease: false @@ -44,8 +78,9 @@ jobs: # get its outputs object, which include a `upload_url`. See this blog # post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./vscode-k3d-${{ github.ref }}.vsix + asset_path: ./vscode-k3d-${{ steps.info.outputs.SOURCE_TAG }}.vsix asset_name: vscode-k3d.vsix + asset_content_type: application/zip # - name: Publish package to marketplace # uses: lannonbr/vsce-action@master diff --git a/package-lock.json b/package-lock.json index 7e9e1f2..48fbf34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-k3d", - "version": "0.0.2", + "version": "0.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index da8bb6f..0f9699f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-k3d", "displayName": "Kubernetes k3d", "description": "Work with the k3d local Kubernetes provider in Visual Studio Code", - "version": "0.0.3", + "version": "0.0.1", "preview": true, "publisher": "ms-kubernetes-tools", "engines": { @@ -74,10 +74,8 @@ "compile": "webpack --mode none", "watch": "webpack --mode none --watch", "postinstall": "node ./node_modules/vscode/bin/install", - "test": "npm run compile && node ./node_modules/vscode/bin/test", "test-compile": "tsc -p ./", - "vscode:prepublish": "webpack --mode production", "dist": "vsce package", "dist-tools": "npm install -g vsce"