Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump version for protected branches #27

Merged
merged 2 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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