From 896f27145cd5247968cf4da3d49b79992d579f28 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 8 Jan 2025 08:45:31 +0000 Subject: [PATCH] Update .gitea/workflows/build_and_puplish.yml --- .gitea/workflows/build_and_puplish.yml | 46 ++++++++++++++++---------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/build_and_puplish.yml b/.gitea/workflows/build_and_puplish.yml index 1cef7c4..464166f 100644 --- a/.gitea/workflows/build_and_puplish.yml +++ b/.gitea/workflows/build_and_puplish.yml @@ -12,21 +12,33 @@ jobs: run: | echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME" echo "Tag name from github.ref_name: ${{ github.ref_name }}" - # - name: Install NodeJS - # uses: actions/setup-node@v4 - # with: - # node-version: 20 - # - name: Install NPM - # run: npm i - # - name: Install VSCE - # run: npm -g i @vscode/vsce - - name: Tag Name - run: echo ${{ gitea.tag }} - # - name: Build Package Files - # run: npm run package - # - name: Publish to Visual Studio Marketplace - # uses: HaaLeo/publish-vscode-extension@v1 - # with: - # pat: ${{ secrets.VSCODE_MARKETPALCE }} - # registryUrl: https://marketplace.visualstudio.com + - name: Install NodeJS + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install NPM Packages + run: npm i + - name: Install VSCE + run: npm -g i @vscode/vsce + - name: Extract tag name + run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Update package.json version + run: | + TAG_NAME=${GITHUB_ENV##*/} + npm version --no-git-tag-version $TAG_NAME + - name: Commit changes + run: | + git config user.name ${{ vars.USERNAME_GIT}} + git config user.email ${{ vars.EMAIL_GIT}} + git add package.json + git commit -m "Update package.json version to $TAG_NAME" + git push origin HEAD + - name: Build Package Files + run: npm run package + - name: Publish to Visual Studio Marketplace + uses: HaaLeo/publish-vscode-extension@v1 + with: + pat: ${{ secrets.VSCODE_MARKETPALCE }} + registryUrl: https://marketplace.visualstudio.com \ No newline at end of file