Update package.json #48
Workflow file for this run
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: SIT Server Mod CI/CD | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18.15.0' | |
- name: Install dependencies | |
run: | | |
npm ci | |
npm i | |
- name: Build | |
run: npm run build | |
- name: Read package.json | |
id: read_package_json | |
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" | |
- name: Log Build Status | |
run: | | |
if [ ${{ job.status }} == 'success' ]; then | |
echo "Build was successful!" | |
else | |
echo "Build failed!" | |
fi | |
if: github.event_name != 'workflow_dispatch' | |
- name: Compress SITCoop folder | |
run: zip -r SITCoop.zip ./SITCoop | |
if: github.event_name == 'workflow_dispatch' | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
if: github.event_name == 'workflow_dispatch' | |
with: | |
tag_name: ${{ steps.read_package_json.outputs.version }} | |
name: SITCoop-${{ steps.read_package_json.outputs.version }} | |
files: SITCoop.zip | |
generate_release_notes: true | |
draft: true | |
token: ${{ secrets.GITHUB_TOKEN }} |