Skip to content
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
24 changes: 17 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: build

on:
push:
branches: [ "main", "build" ]
pull_request:
branches: [ "main" ]
branches:
- main

permissions:
contents: read
Expand All @@ -15,17 +15,25 @@ env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 0
ContinuousIntegrationBuild: true
RestoreLockedMode: true
Configuration: Release
VersionSuffix: preview${{ github.run_id }}

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-24.04, windows-2022 ]
configuration: [ 'Debug', 'Release' ]

runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}

env:
Configuration: ${{ matrix.configuration }}
VersionSuffix: preview${{ github.run_id }}

steps:
- name: checkout
uses: actions/checkout@v4

- name: setup dotnet
uses: actions/setup-dotnet@v4
with:
Expand All @@ -39,12 +47,14 @@ jobs:

- name: test
run: dotnet test --no-build --no-restore
env:
TestNetCoreOnly: ${{ contains(matrix.os, 'ubuntu') }}

- name: pack
run: dotnet pack --no-build --no-restore -o dist
run: dotnet pack --no-build --no-restore -c ${{ matrix.configuration }} -o dist

- name: publish artifact
uses: actions/upload-artifact@v4
with:
name: VbaCompression_${{ env.VersionSuffix }}
name: VbaCompression_${{ env.VersionSuffix }}_${{ matrix.configuration }}_${{ matrix.os }}
path: '${{ github.workspace }}/dist'
15 changes: 13 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
tags: [ 'v*.*.*' ]

permissions:
id-token: write
contents: write

env:
Expand All @@ -21,6 +22,10 @@ jobs:
release:
runs-on: ubuntu-22.04

environment:
name: production
url: https://www.nuget.org/packages/NetOfficeFw.VbaCompression

steps:
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -50,12 +55,18 @@ jobs:
${{ github.workspace }}/dist
${{ github.workspace }}/src/Kavod.Vba.Compression/README.md

- name: authenticate nuget.org
uses: NuGet/login@v1
id: nuget
with:
user: ${{ secrets.NUGET_PUSH_USER }}

- name: publish
working-directory: '${{ github.workspace}}/dist'
run: |
dotnet nuget push "*.nupkg" --api-key "$NUGET_PUSH_KEY" --source https://api.nuget.org/v3/index.json
dotnet nuget push "*.nupkg" --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json
env:
NUGET_PUSH_KEY: ${{ secrets.NUGET_PUSH_KEY }}
NUGET_API_KEY: ${{ steps.nuget.outputs.NUGET_API_KEY }}

- name: release
uses: softprops/action-gh-release@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

dist/

# User-specific files
*.suo
*.user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net48;net8.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(TestNetCoreOnly)' == 'true' ">net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down