Skip to content

Commit

Permalink
Update pack.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
furesoft authored Jul 10, 2024
1 parent 52f5061 commit 700dc4d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/cache@v4
name: Setup Cache
id: cache-setup
with:
path: |
~/.nuget/packages
~/.dotnet
key: ${{ runner.os }}-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand All @@ -21,6 +32,25 @@ jobs:
- name: Install dependencies
run: dotnet restore Source/Silverfly/Silverfly.csproj

- name: Get release version
id: get_release
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Update .csproj file
run: |
RELEASE_VERSION=$(echo ${{ env.RELEASE_VERSION }})
sed -i "s/<Version>.*<\/Version>/<Version>${RELEASE_VERSION}<\/Version>/" Source/Silverfly/Silverfly.csproj
sed -i "s/<Version>.*<\/Version>/<Version>${RELEASE_VERSION}<\/Version>/" Source/Silverfly.Testing/Silverfly.Testing.csproj
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add Source/Silverfly/Silverfly.csproj
git add Source/Silverfly.Testing/Silverfly.Testing.csproj
git commit -m "Update version to ${{ env.RELEASE_VERSION }}"
git push
- name: Build and package
run: |
dotnet build -c Release Source/Silverfly/Silverfly.csproj
Expand Down

0 comments on commit 700dc4d

Please sign in to comment.