Added test for publish bundle pipeline
publish-vs-code-extensions.yml / Publish VS Code Extension (push) Successful in 8s
Publish Action Release / Derive release metadata (push) Successful in 5s
Publish Install Lua Addon Action / test_action (push) Failing after 18s
Publish Action Release / Publish tags (push) Successful in 21s
Publish Install Lua Addon Action / publish_action (push) Successful in 57s
publish-vs-code-extensions.yml / Publish VS Code Extension (push) Successful in 8s
Publish Action Release / Derive release metadata (push) Successful in 5s
Publish Install Lua Addon Action / test_action (push) Failing after 18s
Publish Action Release / Publish tags (push) Successful in 21s
Publish Install Lua Addon Action / publish_action (push) Successful in 57s
This commit is contained in:
@@ -11,6 +11,48 @@ permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
## Verify that when the action has been run it actually has the lua addons installed
|
||||
test_action:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
cache-dependency-path: github-actions/install-lua-addon/package-lock.json
|
||||
|
||||
- name: Run Action Locally
|
||||
uses: ./github-actions/install-lua-addon
|
||||
with:
|
||||
destination-path: './some/test/lua-addons'
|
||||
|
||||
- name: Verify lua addons were installed
|
||||
run: |
|
||||
echo "Listing contents of the Lua addons directory"
|
||||
ls -la ./some/test/lua-addons
|
||||
|
||||
echo "Checking if dcs-types addon was installed"
|
||||
if [ -d "./some/test/lua-addons/dcs-types" ]; then
|
||||
echo "✓ dcs-types directory found"
|
||||
else
|
||||
echo "✗ dcs-types directory not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Checking if config.json exists in dcs-types"
|
||||
if [ -f "./some/test/lua-addons/dcs-types/config.json" ]; then
|
||||
echo "✓ config.json found"
|
||||
else
|
||||
echo "✗ config.json not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "All checks passed!"
|
||||
|
||||
publish_action:
|
||||
uses: ./.github/workflows/_publish-action-release.yml
|
||||
with:
|
||||
|
||||
@@ -34,20 +34,23 @@ jobs:
|
||||
- name: Exit if tag exists
|
||||
if: steps.tag_check.outputs.tag_exists == 'true'
|
||||
run: |
|
||||
echo "Tag already exists, exiting."
|
||||
exit 1
|
||||
echo "::warning::Tag already exists, exiting."
|
||||
exit 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
if: steps.tag_check.outputs.tag_exists == 'false'
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.tag_check.outputs.tag_exists == 'false'
|
||||
run: |
|
||||
cd dutchies-dcs-scripting-tools
|
||||
npm install
|
||||
|
||||
- name: Build extension
|
||||
if: steps.tag_check.outputs.tag_exists == 'false'
|
||||
run: |
|
||||
cd dutchies-dcs-scripting-tools
|
||||
npm run compile
|
||||
|
||||
@@ -9,12 +9,6 @@ inputs:
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Copy lua-addons
|
||||
run: |
|
||||
cp -r ../dutchies-dcs-scripting-tools/lua-addons ./lua-addons
|
||||
shell: bash
|
||||
working-directory: ${{ github.action_path }}
|
||||
|
||||
- name: Build action
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
@@ -1,9 +1,36 @@
|
||||
const esbuild = require("esbuild");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const production = process.argv.includes('--production');
|
||||
const watch = process.argv.includes('--watch');
|
||||
|
||||
async function copyDirectory(src, dest) {
|
||||
await fs.promises.mkdir(dest, { recursive: true });
|
||||
const entries = await fs.promises.readdir(src, { withFileTypes: true });
|
||||
|
||||
for (const entry of entries) {
|
||||
const srcPath = path.join(src, entry.name);
|
||||
const destPath = path.join(dest, entry.name);
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
await copyDirectory(srcPath, destPath);
|
||||
} else {
|
||||
await fs.promises.copyFile(srcPath, destPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// Copy lua-addons to dist directory
|
||||
const luaAddonsSource = path.join(__dirname, '../../dutchies-dcs-scripting-tools/lua-addons');
|
||||
const luaAddonsDest = path.join(__dirname, 'dist/lua-addons');
|
||||
|
||||
if (fs.existsSync(luaAddonsSource)) {
|
||||
await copyDirectory(luaAddonsSource, luaAddonsDest);
|
||||
console.log('Lua addons copied to dist/');
|
||||
}
|
||||
|
||||
const ctx = await esbuild.context({
|
||||
entryPoints: [
|
||||
'src/index.ts'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gh-lua-addon-installer",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "node esbuild.js",
|
||||
|
||||
Reference in New Issue
Block a user