Skip to content

Commit

Permalink
GH Actions review
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandostar committed Feb 24, 2024
1 parent 0dce480 commit 70f2068
Show file tree
Hide file tree
Showing 6 changed files with 300 additions and 169 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/deploy-to-marketplace.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
name: Publish to Visual Studio Marketplace
on:
push:
tags:
- "*"

name: Deploy Extension
workflow_dispatch:
# release:
# types: [released]
jobs:
deploy:
publish_to_marketplace:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Download VSIX file from latest release
id: download_release
uses: robinraju/release-downloader@v1.9
with:
node-version: lts/*
cache: npm
- run: npm install --frozen-lockfile
- run: |
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
pnpm test
- name: Publish to Visual Studio Marketplace
latest: true
fileName: "*.vsix"

# - uses: actions/setup-node@v3
# with:
# node-version: lts/*
# cache: npm
# - run: npm install --frozen-lockfile
# - run: |
# export DISPLAY=:99
# sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
# pnpm test
- name: Publish to VS Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ fromJson(steps.download_release.outputs.downloaded_files)[0] }}
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ${{ fromJson(steps.download_release.outputs.downloaded_files)[0] }}
34 changes: 34 additions & 0 deletions .github/workflows/development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Compile Dev Branch to VSIX

# The workflow will trigger only when changes are pushed to the 'dev' branch
on:
push:
branches: [ dev ]

jobs:
Compile-VSIX:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm install --frozen-lockfile
- name: Setup VSCE
run: npm install -g vsce
# - name: Test
# run: npm test
- name: Package
if: success() # Only upload if the previous 'Test' step succeeded
run: npm run package
- name: Upload VSIX artifact
uses: actions/upload-artifact@v3
with:
name: ttslua-dev-${{ steps.vars.outputs.sha_short }}
path: '*.vsix'
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ on:
push:
branches:
- 'main'
- 'dev'
paths:
- 'docs/**.md'

name: Build Documentation
name: Publish Documentation
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -23,7 +24,7 @@ jobs:
node-version: lts/*
cache: npm
- name: Install Dependencies
run: npm install --frozen-lockfile
run: npm install --frozen-lockfile
- name: Build Documentation
run: npm run build
- name: Upload Artifact
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/releases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Create Release on Tag Push

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'pre-v[0-9]+.[0-9]+.[0-9]+'

jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run compile

- name: Upload VSIX to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: './your-vsix-file.vsix'
asset_name: 'your-vsix-file.vsix'
asset_content_type: 'application/vsix'

- 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 }}
body: |
*Changes or descriptions can go here*
draft: true
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-') }}
Loading

0 comments on commit 70f2068

Please sign in to comment.