Skip to content

Commit

Permalink
build: Automatize tagging and package publishing (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
skarllot authored Apr 6, 2024
1 parent 3440d9e commit c84a1b4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: 🧰 Setup .NET
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
dotnet-version: 8.0.x
global-json-file: global.json
if: matrix.language == 'csharp'

- name: 🗃️ Setup NuGet cache
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create tag

on:
workflow_dispatch:

env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

permissions:
contents: read

jobs:
create-tag:
if: github.actor == 'skarllot'
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: 🛡️ Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit

- name: 🛒 Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: 🧰 Setup .NET
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
global-json-file: global.json

- name: 🛠️ Setup Nerdbank.GitVersioning
run: dotnet tool install --tool-path . nbgv

- name: 🏷️ Tag release
run: ./nbgv tag

- name: 🚀 Push Git tags
run: git push --tags
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: 🧰 Setup .NET
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
dotnet-version: 8.0.x
global-json-file: global.json

- name: 🗃️ Setup NuGet cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Package

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
release:
types: [published]

env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
Expand Down Expand Up @@ -32,7 +31,7 @@ jobs:
- name: 🧰 Setup .NET
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
dotnet-version: 8.0.x
global-json-file: global.json

- name: 🗃️ Setup NuGet cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down

0 comments on commit c84a1b4

Please sign in to comment.