Skip to content

Commit

Permalink
chore: use tmp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
quinton22 committed Jun 21, 2024
1 parent e8027f7 commit 7989320
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ jobs:
- name: Install deps
run: pnpm install
- name: Semantic release
env:
TMP_DIR: ${{ runner.temp }}
run: pnpm semantic-release
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vandy-scheduler",
"repository": "github:quinton22/VandyScheduler",
"repository": "https://github.com/quinton22/VandyScheduler.git",
"engines": {
"node": ">=20.8.1"
},
Expand Down Expand Up @@ -32,15 +32,15 @@
"@semantic-release/exec",
{
"prepareCmd": "./scripts/prepare.sh ${nextRelease.version}",
"publishCmd": "pnpm release --source ./VandyScheduler.zip --extension-id $EXTENSION_ID"
"publishCmd": "pnpm release --source $TMP_DIR/VandyScheduler.zip --extension-id $EXTENSION_ID"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "./VandyScheduler.zip",
"path": "$TMP_DIR/VandyScheduler.zip",
"label": "VandyScheduler.zip"
}
]
Expand Down
14 changes: 6 additions & 8 deletions scripts/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

VS_TEMP=/tmp/VandyScheduler/
VS_TMP=$TMP_DIR/VandyScheduler/


validateVersion() {
Expand Down Expand Up @@ -35,15 +35,14 @@ getFiles() {

copyFiles() {
local files=( "$( getFiles )" )
mkdir /tmp/VandyScheduler
cp -r ./{$(IFS=,; echo "${files[*]}"),manifest.json} $VS_TEMP
mkdir $VS_TMP
cp -r ./{$(IFS=,; echo "${files[*]}"),manifest.json} $VS_TMP
}

createZip() {
local cwd=$( pwd )
cd $VS_TEMP
zip -rq "$cwd/VandyScheduler.zip" *
cd $cwd
cd $VS_TMP
zip -rq "$VS_TMP/VandyScheduler.zip" *
cd -
}

main() {
Expand All @@ -53,7 +52,6 @@ main() {
build
copyFiles
createZip
echo "$( pwd )/VandyScheduler.zip"
}

main $@

0 comments on commit 7989320

Please sign in to comment.