Skip to content

Commit

Permalink
Bump v0.0.9 -pre
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolLoong committed Nov 8, 2024
1 parent a15c6ef commit 8482f7a
Show file tree
Hide file tree
Showing 9 changed files with 673 additions and 21 deletions.
14 changes: 14 additions & 0 deletions .github/scripts/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const {execSync} = require('child_process');
const arch = process.env.MATRIX_ARCH;
const os = process.env.MATRIX_OS;
const rustTarget = process.env.MATRIX_RUST_TARGET;

if (arch === 'arm64' && os === 'ubuntu-latest') {
console.log('Using cross to build...');
execSync('cross build -p jsonui_lsp --verbose --release --target=' + rustTarget, {stdio: 'inherit'});
} else {
console.log('Using cargo to build...');
execSync('rustup set auto-self-update disable', {stdio: 'inherit'});
execSync('rustup target add ' + rustTarget, {stdio: 'inherit'});
execSync('cargo build -p jsonui_lsp --verbose --release --target=' + rustTarget, {stdio: 'inherit'});
}
20 changes: 20 additions & 0 deletions .github/scripts/moveRelease.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const fs = require('fs');
const path = require('path');

const targetDir = process.env.TARGET;
const sourcePaths = [
'target/' + targetDir + '/release/jsonui_lsp',
'target/' + targetDir + '/release/jsonui_lsp.exe'
];
const destDir = 'dist';

sourcePaths.forEach(sourcePath => {
const destPath = path.join(destDir, path.basename(sourcePath));

if (fs.existsSync(sourcePath)) {
fs.renameSync(sourcePath, destPath);
console.log('File', path.basename(sourcePath), 'moved successfully to', destPath);
} else {
console.log('File', path.basename(sourcePath), 'not found at', sourcePath);
}
});
11 changes: 11 additions & 0 deletions .github/scripts/package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const commitMessage = process.env.GITHUB_EVENT_HEAD_COMMIT_MESSAGE;
const target = process.env.TARGET;

const execSync = require('child_process').execSync;
if (commitMessage.includes('-pre')) {
console.log("PreRelease jsonui_lsp " + target)
execSync('npx vsce package --pre-release --target ' + target + ' --no-dependencies', {stdio: 'inherit'});
} else {
console.log("Release jsonui_lsp " + target)
execSync('npx vsce package --target ' + target + ' --no-dependencies', {stdio: 'inherit'});
}
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ jobs:
if: matrix.arch == 'arm64' && matrix.os == 'ubuntu-latest'
run: cargo install cross
- name: Build with Cargo or Cross
run: |
node -e "const { execSync } = require('child_process'); const arch = process.env.MATRIX_ARCH; const os = process.env.MATRIX_OS; const rustTarget = process.env.MATRIX_RUST_TARGET; if (arch === 'arm64' && os === 'ubuntu-latest') { console.log('Using cross to build...'); execSync('cross build --verbose --release --target=' + rustTarget, { stdio: 'inherit' }); } else { console.log('Using cargo to build...'); execSync('rustup set auto-self-update disable', { stdio: 'inherit' }); execSync('rustup target add ' + rustTarget, { stdio: 'inherit' }); execSync('cargo build --verbose --release --target=' + rustTarget, { stdio: 'inherit' }); }"
run: node .github/scripts/build.js
env:
MATRIX_ARCH: ${{ matrix.arch }}
MATRIX_OS: ${{ matrix.os }}
Expand All @@ -65,17 +64,15 @@ jobs:
- name: build client and move execute file
run: |
npx webpack --mode production --config webpack.config.js
node -e "const fs = require('fs'); const path = require('path'); const targetDir = process.env.TARGET; const sourcePaths = ['target/' + targetDir + '/release/jsonui-lsp', 'target/' + targetDir + '/release/jsonui-lsp.exe']; const destDir = 'dist'; sourcePaths.forEach(sourcePath => { const destPath = path.join(destDir, path.basename(sourcePath)); if (fs.existsSync(sourcePath)) { fs.renameSync(sourcePath, destPath); console.log('File', path.basename(sourcePath), 'moved successfully to', destPath); } else { console.log('File', path.basename(sourcePath), 'not found at', sourcePath); } });"
node .github/scripts/moveRelease.js
env:
TARGET: ${{ matrix.rust_target }}
- shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- run: |
if [[ "${{ github.event.head_commit.message }}" == *"-pre"* ]]; then
npx vsce package --pre-release --target ${{ env.target }}
else
npx vsce package --target ${{ env.target }}
fi
- run: node .github/scripts/package.js
env:
GITHUB_EVENT_HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
TARGET: ${{ env.target }}
- uses: actions/upload-artifact@v4
with:
name: ${{ env.target }}
Expand All @@ -88,10 +85,13 @@ jobs:
steps:
- uses: actions/download-artifact@v4
- run: |
echo "Checking commit message for '-pre'..."
if [[ "${{ github.event.head_commit.message }}" == *"-pre"* ]]; then
npx vsce publish --pre-release --packagePath $(find . -iname *.vsix)
echo "Publishing pre-release version..."
npx vsce publish --pre-release --packagePath $(find . -iname *.vsix) --no-dependencies
else
npx vsce publish --packagePath $(find . -iname *.vsix)
echo "Publishing stable version..."
npx vsce publish --packagePath $(find . -iname *.vsix) --no-dependencies
fi
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
8 changes: 3 additions & 5 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
.cargo
.github
.vscode
.idea
client/**
crates/**
node_modules
resources
out
.idea
src
logs
target
test
vanillapack_define_gen
.gitignore
Cargo.lock
Cargo.toml
Expand Down
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Change Log

All notable changes to the "rust-feature-toggler" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [0.0.8] - 2024-11-08
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jsonui-support-client",
"description": "A VSCode extension providing intelligent code completion for Minecraft Bedrock JSON-UI.",
"license": "MIT",
"version": "0.0.8",
"version": "0.0.9",
"engines": {
"vscode": "^1.85.0"
},
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"description": "jsonui support",
"publisher": "CoolLoong",
"license": "MIT",
"version": "0.0.8",
"version": "0.0.9",
"icon": "icon.png",
"categories": ["Snippets"],
"categories": [
"Snippets"
],
"keywords": [
"minecraft",
"bedrock",
Expand Down Expand Up @@ -80,6 +82,7 @@
"eslint": "^7.6.0",
"glob": "^7.1.7",
"mocha": "^8.0.1",
"vsce": "^2.15.0",
"rimraf": "^6.0.1",
"ts-loader": "^9.5.1",
"typescript": "5.4.5",
Expand Down
Loading

0 comments on commit 8482f7a

Please sign in to comment.