Skip to content

[GHA TEST] Update version 1.8.2 -> 1.9.0 #1

[GHA TEST] Update version 1.8.2 -> 1.9.0

[GHA TEST] Update version 1.8.2 -> 1.9.0 #1

name: Check Version & Release
on:
push:
branches:
- main
paths:
- app/package.json
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
before_version: ${{ steps.check-version.outputs.before_version }}
after_version: ${{ steps.check-version.outputs.after_version }}
version_changed: ${{ steps.check-version.outputs.version_changed }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install -y jq
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Get current and previous versions
id: check-version
run: |
git fetch origin ${{ github.event.before }} ${{ github.event.after }}
BEFORE_VERSION=$(git show ${{ github.event.before }}:app/package.json | jq -r '.version')
AFTER_VERSION=$(git show ${{ github.event.after }}:app/package.json | jq -r '.version')
echo "Before version: $BEFORE_VERSION"
echo "After version: $AFTER_VERSION"
echo "before_version=$BEFORE_VERSION" >> $GITHUB_OUTPUT
echo "after_version=$AFTER_VERSION" >> $GITHUB_OUTPUT
if [ "$BEFORE_VERSION" != "$AFTER_VERSION" ]; then
echo "Version changed from $BEFORE_VERSION to $AFTER_VERSION."
echo "version_changed=true" >> $GITHUB_OUTPUT
else
echo "Version did not change."
echo "version_changed=false" >> $GITHUB_OUTPUT
fi
release:
runs-on: ubuntu-latest
needs: check-version
if: needs.check-version.outputs.version_changed == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '3.1.x'
- name: Build `src` into `app/api/`
run: dotnet build src -c Release -r win-x86 -o app/api/win-x86
run: dotnet build src -c Release -r linux-x64 -o app/api/linux-x64

Check failure on line 66 in .github/workflows/check-version-and-release.yaml

View workflow run for this annotation

GitHub Actions / Check Version & Release

Invalid workflow file

The workflow is not valid. .github/workflows/check-version-and-release.yaml (Line: 66, Col: 9): 'run' is already defined
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install npm dependencies
run: npm install
- name: Run npm release script
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: npm run release