Skip to content

Commit

Permalink
Merge pull request #27 from h1dden-da3m0n/fix/bump-version
Browse files Browse the repository at this point in the history
  • Loading branch information
crobibero authored May 8, 2022
2 parents 8ad558c + 5485313 commit af74ae7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/bump-version.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# DEPRECATED: Please use / rely on the changelog workflow as that works with protected branches

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -36,11 +38,6 @@ jobs:
- name: Checkout Repository
uses: actions/[email protected]

- name: Setup YQ
uses: chrisdickinson/[email protected]
with:
yq-version: v4.16.2

- name: Read current version
run: |-
echo "CURRENT_VERSION=$(yq eval '.version' build.yaml)"
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,11 @@ jobs:
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- name: Update Draft
uses: release-drafter/release-drafter@v5.16.1
uses: release-drafter/release-drafter@v5.19.0
id: draft
env:
GITHUB_TOKEN: ${{ secrets.token }}

- name: Setup YQ
uses: chrisdickinson/[email protected]
with:
yq-version: v4.16.2

- name: Set-up Environment
run: |-
TAG="${{ steps.draft.outputs.tag_name }}"
Expand All @@ -59,7 +54,16 @@ jobs:
- name: Update build.yaml
if: ${{ env.HAS_CHANGES == 'true' }}
run: |-
yq eval '.targetAbi = env(ABI_VERSION) | .changelog = strenv(CHANGELOG) | .changelog style="literal"' -i build.yaml
if [[ -f Directory.Build.props ]]; then
# https://stackoverflow.com/a/57510475
# https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022
sed -i Directory.Build.props \
-e "s;<Version>.*</Version>;<Version>${VERSION}.0.0.0</Version>;" \
-e "s;<AssemblyVersion>.*</AssemblyVersion>;<AssemblyVersion>${VERSION}.0.0.0</AssemblyVersion>;" \
-e "s;<FileVersion>.*</FileVersion>;<FileVersion>${VERSION}.0.0.0</FileVersion>;"
fi
yq eval '.version = env(VERSION) | .targetAbi = env(ABI_VERSION) | .changelog = strenv(CHANGELOG) | .changelog style="literal"' -i build.yaml
- name: Commit Changes
if: ${{ env.HAS_CHANGES == 'true' }}
Expand Down

0 comments on commit af74ae7

Please sign in to comment.