Skip to content

Commit

Permalink
Add vscode vsix file to release
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwn committed Apr 25, 2024
1 parent def9ad5 commit e669c3a
Show file tree
Hide file tree
Showing 6 changed files with 3,204 additions and 102 deletions.
1 change: 1 addition & 0 deletions .github/release_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ ${CHECKSUM_LINUX_64}
${CHECKSUM_WIN_64}
${CHECKSUM_MACOS_86_64}
${CHECKSUM_MACOS_ARM64}
${CHECKSUM_VSIX}
```
102 changes: 65 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,37 @@ jobs:
- name: Test executable
run: |
./dist/${{ matrix.asset_name }} --version
- name: Upload executable
run: |
./dist/${{ matrix.asset_name }} --version
- uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ./dist/{{ matrix.asset_name }}
path: ./dist/${{ matrix.asset_name }}
if-no-files-found: error

build_vscode_extension:
runs-on: ubuntu-latest
strategy:
fail-fast: true
defaults:
run:
working-directory: vscode
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm install
- name: Create vsix file for package
run: npx vsce package -o souffle-analyzer.vsix
- name: Upload vscode package
uses: actions/upload-artifact@v4
with:
name: souffle-analyzer.vsix
path: ./vscode/souffle-analyzer.vsix
if-no-files-found: error

publish:
needs: [build_binaries]
needs: [build_binaries, build_vscode_extension]
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
Expand Down Expand Up @@ -88,32 +107,39 @@ jobs:
git push origin :stable || true
- name: Generate SHA256 checksum for souffle-analyzer-linux64
run: |
EXEC="souffle-analyzer-linux64"
cd "./$EXEC"
CHECKSUM=$(sha256sum "$EXEC")
echo "$CHECKSUM" > "$EXEC.sha256sum"
echo "CHECKSUM_LINUX_64=$(echo $CHECKSUM)" >> "$GITHUB_ENV"
ARTIFACT="souffle-analyzer-linux64"
cd "./$ARTIFACT"
CHECKSUM=$(sha256sum "$ARTIFACT")
echo "$CHECKSUM" > "$ARTIFACT.sha256sum"
echo "CHECKSUM_LINUX_64=$CHECKSUM" >> "$GITHUB_ENV"
- name: Generate SHA256 checksum for souffle-analyzer-win64.exe
run: |
EXEC="souffle-analyzer-win64.exe"
cd "./$EXEC"
CHECKSUM=$(sha256sum "$EXEC")
echo "$CHECKSUM" > "$EXEC.sha256sum"
echo "CHECKSUM_WIN_64=$(echo $CHECKSUM)" >> "$GITHUB_ENV"
ARTIFACT="souffle-analyzer-win64.exe"
cd "./$ARTIFACT"
CHECKSUM=$(sha256sum "$ARTIFACT")
echo "$CHECKSUM" > "$ARTIFACT.sha256sum"
echo "CHECKSUM_WIN_64=$CHECKSUM" >> "$GITHUB_ENV"
- name: Generate SHA256 checksum for souffle-analyzer-macos-x86-64
run: |
EXEC="souffle-analyzer-macos-x86-64"
cd "./$EXEC"
CHECKSUM=$(sha256sum "$EXEC")
echo "$CHECKSUM" > "$EXEC.sha256sum"
echo "CHECKSUM_MACOS_86_64=$(echo $CHECKSUM)" >> "$GITHUB_ENV"
ARTIFACT="souffle-analyzer-macos-x86-64"
cd "./$ARTIFACT"
CHECKSUM=$(sha256sum "$ARTIFACT")
echo "$CHECKSUM" > "$ARTIFACT.sha256sum"
echo "CHECKSUM_MACOS_86_64=$CHECKSUM" >> "$GITHUB_ENV"
- name: Generate SHA256 checksum for souffle-analyzer-macos-x86-64
run: |
EXEC="souffle-analyzer-macos-arm64"
cd "./$EXEC"
CHECKSUM=$(sha256sum "$EXEC")
echo "$CHECKSUM" > "$EXEC.sha256sum"
echo "CHECKSUM_MACOS_ARM64=$(echo $CHECKSUM)" >> "$GITHUB_ENV"
ARTIFACT="souffle-analyzer-macos-arm64"
cd "./$ARTIFACT"
CHECKSUM=$(sha256sum "$ARTIFACT")
echo "$CHECKSUM" > "$ARTIFACT.sha256sum"
echo "CHECKSUM_MACOS_ARM64=$CHECKSUM" >> "$GITHUB_ENV"
- name: Generate SHA256 checksum for souffle-analyzer.vsix
run: |
ARTIFACT="souffle-analyzer.vsix"
cd "./$ARTIFACT"
CHECKSUM=$(sha256sum "$ARTIFACT")
echo "$CHECKSUM" > "$ARTIFACT.sha256sum"
echo "CHECKSUM_VSIX=$CHECKSUM" >> "$GITHUB_ENV"
- name: Publish release
run: |
envsubst < "$GITHUB_WORKSPACE/.github/release_template.md" > "$RUNNER_TEMP/release_template.md"
Expand All @@ -122,18 +148,20 @@ jobs:
--prerelease \
--notes-file "$RUNNER_TEMP/release_template.md" \
--title "$RELEASE_TITLE" \
--target $GITHUB_SHA \
souffle-analyzer-linux64/* \
souffle-analyzer-win64/* \
souffle-analyzer-macos-x86-64/* \
souffle-analyzer-macos-arm64/*
--target "$GITHUB_SHA" \
"souffle-analyzer-linux64/*" \
"souffle-analyzer-win64/*" \
"souffle-analyzer-macos-x86-64/*" \
"souffle-analyzer-macos-arm64/*"
"souffle-analyzer-vsix/*"
else
gh release create stable \
--notes-file "$RUNNER_TEMP/release_template.md" \
--title "$RELEASE_TITLE" \
--target $GITHUB_SHA \
souffle-analyzer-linux64/* \
souffle-analyzer-win64/* \
souffle-analyzer-macos-x86-64/* \
souffle-analyzer-macos-arm64/*
--target "$GITHUB_SHA" \
"souffle-analyzer-linux64/*" \
"souffle-analyzer-win64/*" \
"souffle-analyzer-macos-x86-64/*" \
"souffle-analyzer-macos-arm64/*"
"souffle-analyzer-vsix/*"
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# VSCode extension
*.vsix
21 changes: 21 additions & 0 deletions vscode/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Nhat M. Nguyen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit e669c3a

Please sign in to comment.