Merge branch 'sparx-v2' of https://github.com/NajmAjmal/azalea into s… #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 Azalea-maths and Release | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build codebase and release | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get version | |
id: version | |
run: | | |
version=$(cat ./extension/manifest.json | grep -oE '[ ]+"version": "(.*)",' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') | |
echo "value=$version" >> $GITHUB_OUTPUT | |
- name: Install dependencies | |
id: dependencies | |
run: | | |
npm i -g pnpm | |
pnpm i | |
- name: Build codebase | |
id: build | |
run: pnpm build | |
- name: Prepare for release | |
id: prepare | |
run: | | |
rm $GITHUB_WORKSPACE/builds/* || true | |
mkdir builds || true | |
mv dist/bundle.js ./builds | |
mv dist Azalea-${{ steps.version.outputs.value }} | |
zip -r Azalea.zip Azalea-${{ steps.version.outputs.value }} & wait $!; | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add builds | |
git commit -m "Build $GITHUB_SHA" || exit 0 | |
git push | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
tag_name: "${{ steps.version.outputs.value }}" | |
name: "Azalea ${{ steps.version.outputs.value }}" | |
files: | | |
./*.zip |