Update stormlib to fix windows build #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: push | |
jobs: | |
build-and-release: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: npm install | |
- name: Build the project | |
run: npm run bundle | |
- name: Check if Tag Exists | |
id: check_tag | |
run: | | |
version=$(node -e "console.log(require('./package.json').version)") | |
tag_exists=$(git ls-remote --tags origin "refs/tags/v$version") | |
if [ -z "$tag_exists" ]; then | |
echo "Tag does not exist. Creating tag..." | |
git config --global user.email "[email protected]" | |
git config --global user.name "${{ github.actor }}" | |
git tag -a -m "Tag for version $version" "v$version" | |
git push origin "v$version" | |
else | |
echo "Tag v$version already exists." | |
fi | |
echo "::set-output name=tag_name::v$version" | |
shell: bash | |
- name: Determine Artifact File | |
id: determine_artifact | |
run: | | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
echo "::set-output name=artifact_file::haax-mpq.exe" | |
else | |
echo "::set-output name=artifact_file::haax-mpq" | |
fi | |
shell: bash | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ steps.determine_artifact.outputs.artifact_file }} | |
tag_name: ${{ steps.check_tag.outputs.tag_name }} |