Skip to content

Commit

Permalink
Update CI (#1352)
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano committed Apr 22, 2024
1 parent e4ddce9 commit bf5ede1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 60 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -35,11 +35,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
43 changes: 15 additions & 28 deletions .github/workflows/main.yml
Expand Up @@ -8,7 +8,6 @@ on:
- "docs/**"
- ".vscode/**"
- ".github/**"
- "*.md"
- "**/*.md"
pull_request:
branches:
Expand All @@ -24,18 +23,15 @@ concurrency:
jobs:
build:
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ubuntu-latest
outputs:
taggedbranch: ${{ steps.find-branch.outputs.taggedbranch }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Find which branch the release tag points at
id: find-branch
if: github.event_name == 'release' && runner.os == 'Linux'
if: github.event_name == 'release'
shell: bash
run: |
git fetch --depth=1 origin +refs/heads/*:refs/heads/*
Expand All @@ -44,7 +40,6 @@ jobs:
echo "taggedbranch=$TAGGEDBRANCH" >> $GITHUB_OUTPUT
- name: Set an output
id: set-version
if: runner.os == 'Linux'
run: |
set -x
VERSION=$(jq -r '.version' package.json | cut -d- -f1)
Expand All @@ -64,29 +59,24 @@ jobs:
echo $VERSION > .version
echo $NAME > .name
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: npm install
- name: lint
if: runner.os == 'Linux'
run: npm run lint
- run: npm run compile
- name: npm test
uses: coactions/setup-xvfb@v1
with:
run: npm run test
run: xvfb-run npm test
- name: Build package
if: runner.os == 'Linux'
run: |
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
- uses: actions/upload-artifact@v3
if: (runner.os == 'Linux') && (github.event_name != 'release')
- uses: actions/upload-artifact@v4
if: github.event_name != 'release'
with:
name: ${{ steps.set-version.outputs.name }}.vsix
path: ${{ steps.set-version.outputs.name }}.vsix
- uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
- uses: actions/upload-artifact@v4
with:
name: meta
path: |
Expand All @@ -97,24 +87,22 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: meta
path: .
- name: Set an output
id: set-version
if: runner.os == 'Linux'
run: |
set -x
echo "version=`cat .version`" >> $GITHUB_OUTPUT
echo "name=`cat .name`" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ steps.set-version.outputs.name }}.vsix
- name: Create Release
id: create-release
uses: softprops/action-gh-release@v1
if: runner.os == 'Linux'
with:
tag_name: v${{ steps.set-version.outputs.version }}
prerelease: ${{ github.event_name != 'release' }}
Expand All @@ -125,18 +113,18 @@ jobs:
if: github.event_name == 'release' && needs.build.outputs.taggedbranch == 'master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.TOKEN }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: meta
path: .
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Prepare build
id: set-version
run: |
Expand All @@ -159,7 +147,6 @@ jobs:
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
if: runner.os == 'Linux'
with:
tag_name: ${{ github.event.release.tag_name }}
files: ${{ steps.set-version.outputs.name }}.vsix
Expand Down
43 changes: 15 additions & 28 deletions .github/workflows/prerelease.yml
Expand Up @@ -8,7 +8,6 @@ on:
- "docs/**"
- ".vscode/**"
- ".github/**"
- "*.md"
- "**/*.md"
pull_request:
branches:
Expand All @@ -19,18 +18,15 @@ on:
jobs:
build:
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ubuntu-latest
outputs:
taggedbranch: ${{ steps.find-branch.outputs.taggedbranch }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Find which branch the release tag points at
id: find-branch
if: github.event_name == 'release' && runner.os == 'Linux'
if: github.event_name == 'release'
shell: bash
run: |
git fetch --depth=1 origin +refs/heads/*:refs/heads/*
Expand All @@ -39,7 +35,6 @@ jobs:
echo "taggedbranch=$TAGGEDBRANCH" >> $GITHUB_OUTPUT
- name: Set an output
id: set-version
if: runner.os == 'Linux'
run: |
set -x
VERSION=$(jq -r '.version' package.json | cut -d- -f1)
Expand All @@ -59,29 +54,24 @@ jobs:
echo $VERSION > .version
echo $NAME > .name
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: npm install
- name: lint
if: runner.os == 'Linux'
run: npm run lint
- run: npm run compile
- name: npm test
uses: coactions/setup-xvfb@v1
with:
run: npm run test
run: xvfb-run npm test
- name: Build pre-release package
if: runner.os == 'Linux'
run: |
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
- uses: actions/upload-artifact@v3
if: (runner.os == 'Linux') && (github.event_name != 'release')
- uses: actions/upload-artifact@v4
if: github.event_name != 'release'
with:
name: ${{ steps.set-version.outputs.name }}.vsix
path: ${{ steps.set-version.outputs.name }}.vsix
- uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
- uses: actions/upload-artifact@v4
with:
name: meta
path: |
Expand All @@ -92,24 +82,22 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: meta
path: .
- name: Set an output
id: set-version
if: runner.os == 'Linux'
run: |
set -x
echo "version=`cat .version`" >> $GITHUB_OUTPUT
echo "name=`cat .name`" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ steps.set-version.outputs.name }}.vsix
- name: Create Pre-Release
id: create-release
uses: softprops/action-gh-release@v1
if: runner.os == 'Linux'
with:
tag_name: v${{ steps.set-version.outputs.version }}
prerelease: ${{ github.event_name != 'release' }}
Expand All @@ -120,18 +108,18 @@ jobs:
if: github.event_name == 'release' && needs.build.outputs.taggedbranch == 'prerelease'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: prerelease
token: ${{ secrets.TOKEN }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: meta
path: .
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Prepare pre-release build
id: set-version
run: |
Expand All @@ -154,7 +142,6 @@ jobs:
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
if: runner.os == 'Linux'
with:
tag_name: ${{ github.event.release.tag_name }}
files: ${{ steps.set-version.outputs.name }}.vsix
Expand Down

0 comments on commit bf5ede1

Please sign in to comment.