Skip to content

chore: env vars

chore: env vars #39

Workflow file for this run

name: Publish
on:
pull_request:
branches: [main]
paths:
- "mcfunction.*"
push:
branches: [main]
tags: ["v*.*.*"]
jobs:
ci:
runs-on: ubuntu-latest
steps:
# ---------------------------------------------
# ----- gather repo -----
# ---------------------------------------------
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: npm
- name: Install npm stuff
run: |
npm install -g @vscode/vsce
npm install -g js-yaml
npm install -g ovsx
- name: Export JSON from YAML
run: js-yaml mcfunction.tmLanguage.yaml > mcfunction.tmLanguage.json
- name: Push JSON to repo for sublime (if not matched)
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add mcfunction.tmLanguage.json
git commit -m "🤖 Generate JSON"
git push origin main
continue-on-error: true
- id: package
name: Package VSCode Ext
run: |
vsce package
VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
echo "ext=syntax-mcfunction-$VERSION.vsix" >> "$GITHUB_OUTPUT"
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: "!startsWith(github.ref, 'refs/tags/')"
with:
name: dist-without-markdown
path: |
"${{ steps.package.outputs.ext }}"
"mcfunction.tmLanguage.yaml"
"mcfunction.tmLanguage.json"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
"*.vsix"
"mcfunction.tmLanguage.yaml"
"mcfunction.tmLanguage.json"
- name: Release to openvsix
if: startsWith(github.ref, 'refs/tags/')
run: npx ovsx publish ${{ steps.package.outputs.ext }} -p ${{ secrets.OVSX }}