Skip to content

Commit eec3f2b

Browse files
committed
ci: updates to workflows
1 parent e1b28f9 commit eec3f2b

2 files changed

Lines changed: 49 additions & 28 deletions

File tree

.github/workflows/docs-deploy.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77
paths-ignore:
88
- '!docs/**'
99

10-
workflow_dispatch:
10+
workflow_dispatch:
1111

1212
jobs:
1313
deploy:
1414
name: 📃 Deploy new version bunit.dev
1515
runs-on: windows-latest
1616
steps:
17-
17+
1818
- name: 🛒 Checkout repository
1919
uses: actions/checkout@v2
2020
with:
@@ -26,18 +26,18 @@ jobs:
2626
with:
2727
gpg-private-key: ${{ secrets.BUNIT_BOT_GPG_PRIVATE_KEY }}
2828
passphrase: ${{ secrets.BUNIT_BOT_GPG_KEY_PASSPHRASE }}
29-
29+
3030
- name: ⚙️ Setup CI GIT
3131
run: |
3232
git config user.name "${{ steps.import_gpg.outputs.name }}"
3333
git config user.email ${{ steps.import_gpg.outputs.email }}
3434
git config --global user.signingkey ${{ steps.import_gpg.outputs.keyid }}
35-
git config --global commit.gpgsign true
35+
git config --global commit.gpgsign true
3636
3737
- name: ⚙️ Setup GIT versioning
3838
uses: dotnet/nbgv@v0.4.0
3939
with:
40-
setAllVars: true
40+
setAllVars: true
4141

4242
- name: 🛠️ Get Changelog Entry
4343
id: changelog_reader
@@ -51,7 +51,7 @@ jobs:
5151
RELEASE-VERSION: ${{ steps.changelog_reader.outputs.version }}
5252
with:
5353
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj"]'
54-
54+
5555
- name: ⚙️ Setup dotnet 3.1.x
5656
uses: actions/setup-dotnet@v1
5757
with:
@@ -72,7 +72,7 @@ jobs:
7272
run: |
7373
dotnet build docs/site/
7474
dotnet build docs/site/
75-
75+
7676
- name: 🛠️ Deploy to GitHub Pages
7777
if: success()
7878
uses: crazy-max/ghaction-github-pages@v2
@@ -87,3 +87,24 @@ jobs:
8787
env:
8888
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8989
GH_PAT: ${{ secrets.BUNIT_BOT_TOKEN }}
90+
91+
- name: ⏩ Merge stable with main, push origin
92+
run: |
93+
git checkout main
94+
git merge -S stable
95+
git push origin main
96+
97+
- name: ⏭ Create pull request from stable to main when direct merge fails
98+
if: ${{ failure() }}
99+
uses: thomaseizinger/create-pull-request@1.0.0
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
with:
103+
head: stable
104+
base: main
105+
title: Update main with documentation in stable
106+
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
107+
body: |
108+
Hi @${{ github.actor }}
109+
110+
This PR was created because the [docs-deploy](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed to automatically merge stable into main.

.github/workflows/release.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,57 @@ on:
88
types:
99
- closed
1010
paths-ignore:
11-
- 'docs/**'
11+
- 'docs/**'
1212

1313
workflow_dispatch:
14-
15-
jobs:
14+
15+
jobs:
1616
release:
1717
name: 🎁 Publish new release
1818
# Only run on manual dispatch or on merged 'release-' pull requests
19-
if: github.ref == 'refs/heads/stable' ||
19+
if: github.ref == 'refs/heads/stable' ||
2020
github.event.pull_request.merged == true && contains(github.head_ref, 'release/v') == true
2121
runs-on: ubuntu-latest
2222
steps:
23-
23+
2424
- name: 🛒 Checkout repository
2525
uses: actions/checkout@v2
2626
with:
2727
fetch-depth: 0
2828
token: ${{ secrets.BUNIT_BOT_TOKEN }}
29-
29+
3030
- name: 🛠️ Get Changelog Entry
3131
id: changelog_reader
3232
uses: mindsers/changelog-reader-action@v2
3333
with:
3434
version: Unreleased
3535
path: ./CHANGELOG.md
36-
36+
3737
- name: ☑ Check that release contains changes
3838
if: steps.changelog_reader.outputs.changes == ''
3939
run: |
4040
echo "::error file=CHANGELOG.md::The unreleased section in the changelog is empty. Nothing to release."
4141
exit 1
42-
42+
4343
- name: ⚙️ Import GPG key
4444
id: import_gpg
4545
uses: crazy-max/ghaction-import-gpg@v3
4646
with:
4747
gpg-private-key: ${{ secrets.BUNIT_BOT_GPG_PRIVATE_KEY }}
4848
passphrase: ${{ secrets.BUNIT_BOT_GPG_KEY_PASSPHRASE }}
49-
49+
5050
- name: ⚙️ Setup CI GIT
5151
run: |
5252
git config user.name "${{ steps.import_gpg.outputs.name }}"
5353
git config user.email ${{ steps.import_gpg.outputs.email }}
5454
git config --global user.signingkey ${{ steps.import_gpg.outputs.keyid }}
55-
git config --global commit.gpgsign true
56-
55+
git config --global commit.gpgsign true
56+
5757
- name: ⚙️ Setup GIT versioning
5858
uses: dotnet/nbgv@v0.4.0
5959
with:
60-
setAllVars: true
61-
60+
setAllVars: true
61+
6262
- name: ⚙️ Setup dotnet 5.0.x
6363
uses: actions/setup-dotnet@v1
6464
with:
@@ -68,13 +68,13 @@ jobs:
6868
uses: thomaseizinger/keep-a-changelog-new-release@1.2.1
6969
with:
7070
version: ${{ env.NBGV_SemVer2 }}
71-
71+
7272
- name: 🛠️ Update changelog compare URLs
7373
shell: bash
7474
run: |
7575
sed -i -E "s/compare\/([0-9]+\.[0-9]+\.[0-9]+)\.\.\.([0-9]+\.[0-9]+\.[0-9]+)/compare\/v\1...v\2/" CHANGELOG.md
7676
sed -i -E "s/compare\/([0-9]+\.[0-9]+\.[0-9]+)\.\.\.HEAD/compare\/v\1...HEAD/" CHANGELOG.md
77-
77+
7878
- name: 🛠️ Commit CHANGELOG.md to stable branch
7979
run: |
8080
git add CHANGELOG.md
@@ -91,7 +91,7 @@ jobs:
9191
dotnet pack -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true
9292
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true
9393
dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true
94-
94+
9595
- name: 🛠️ Upload library to NuGet.org repository
9696
run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols true
9797

@@ -109,13 +109,13 @@ jobs:
109109
body: ${{ steps.changelog_reader.outputs.changes }}
110110
draft: false
111111
prerelease: ${{ env.NBGV_PublicRelease == 'False' }}
112-
113-
- name: ⏩ Merge stable with main, push main
114-
run: |
112+
113+
- name: ⏩ Merge stable with main, push to origin
114+
run: |
115115
git checkout main
116116
git merge -S stable
117117
git push origin main
118-
118+
119119
- name: ⏭ Create pull request from stable to main when direct merge fails
120120
if: ${{ failure() }}
121121
uses: thomaseizinger/create-pull-request@1.0.0
@@ -128,5 +128,5 @@ jobs:
128128
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
129129
body: |
130130
Hi @${{ github.actor }}
131-
131+
132132
This PR was created because the [release workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed to automatically merge stable into main.

0 commit comments

Comments
 (0)