Files
nx_post_support/.gitea/workflows/build_and_puplish.yml
T
Christoph Brandau ef558c3aa3
/ build_and_publish (release) Successful in 28s
update pipline
2025-08-11 17:19:47 +02:00

76 lines
3.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
on:
release:
types: [published]
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout branch from release
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
fetch-depth: 0
- name: GitHub Tag Name example
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 Packages
run: |
npm i
cd ./client
npm i
cd ..
- name: Install VSCE
run: npm -g i @vscode/vsce
- name: Build Package Files
run: npm run package
- name: Update package.json Version
run: npm version ${{ github.ref_name }} --no-git-tag-version
- name: Commit and Push Changes
run: |
git config user.name "${{ vars.USERNAME_GIT }}"
git config user.email "${{ vars.EMAIL_GIT }}"
git add package.json
git commit -m "Update version to ${{ github.ref_name }}" || echo "No changes to commit."
# Get current branch; if detached, resolve to a remote branch that contains this commit
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$BRANCH" == "HEAD" || -z "$BRANCH" ]]; then
# If target_commitish is a branch, use it; if its a SHA, find a branch that contains it
CANDIDATE='${{ github.event.release.target_commitish }}'
if [[ "$CANDIDATE" =~ ^[0-9a-f]{40}$ ]]; then
BRANCH="$(git branch -r --contains "$GITHUB_SHA" | sed -n 's|.*origin/||p' | head -n1)"
else
BRANCH="$CANDIDATE"
fi
fi
if [[ -z "$BRANCH" ]]; then
echo "Could not determine branch for push."; git branch -a; exit 1
fi
git push origin HEAD:refs/heads/$BRANCH
- name: Publish to Visual Studio Marketplace (Pre-Release)
if: ${{ github.event.release.prerelease }}
run: vsce publish --pre-release
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPALCE }}
- name: Publish to Visual Studio Marketplace (Stable)
if: ${{ !github.event.release.prerelease }}
run: vsce publish
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPALCE }}
- name: Pack Extension for Release
run: vsce pack
- name: Upload VSIX to Release
uses: softprops/action-gh-release@v1
with:
files: "nx-post-support-*.vsix"
# generate_release_notes: true # Automatische Release Notes
# draft: false # N
# prerelease: false