This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
chore(deps): update actions/cache action to v4.0.2 (#80) #331
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
env: | |
DOTNET_NOLOGO: true | |
ProjectLoadStyle: All | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: windows-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 2 | |
filter: blob:none | |
show-progress: false | |
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.nuget/packages | |
# Look to see if there is a cache hit for the corresponding requirements file | |
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} | |
# restore-keys: | | |
# ${{ runner.os }}-nuget | |
- name: restore | |
run: dotnet restore | |
- name: build | |
run: dotnet build --no-restore | |
- name: test | |
run: dotnet test --no-build | |
- name: Codecov | |
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0 | |
with: | |
files: '**/TestResults/*/*.cobertura.xml' | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
needs: [test] | |
runs-on: windows-latest | |
timeout-minutes: 15 | |
permissions: | |
contents: write | |
packages: write | |
env: | |
VO: true | |
Configuration: Release | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
show-progress: false | |
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.nuget/packages | |
# Look to see if there is a cache hit for the corresponding requirements file | |
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} | |
# restore-keys: | | |
# ${{ runner.os }}-nuget | |
- name: pack | |
run: dotnet pack -o bin .\OpenXmlPowerTools\ | |
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
with: | |
name: packages | |
path: bin/*.nupkg | |
- name: deploy github.com | |
if: ${{ github.ref_type == 'tag' }} | |
run: find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output | |
shell: bash | |
env: | |
NUGET_SOURCE: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
NUGET_KEY: ${{ secrets.GITHUB_TOKEN }} | |
- name: deploy nuget.org | |
if: ${{ github.ref_type == 'tag' }} | |
run: find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output | |
shell: bash | |
env: | |
NUGET_SOURCE: https://api.nuget.org/v3/index.json | |
NUGET_KEY: ${{ secrets.NUGET_API_KEY }} | |
gh-release: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: ${{ github.ref_type == 'tag' }} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 # Important for changelog | |
filter: blob:none | |
show-progress: false | |
- name: prepare version | |
run: echo VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_ENV # trim leading 'v' from tag name | |
- name: Generate changelog with git-cliff | |
uses: tj-actions/git-cliff@75599f745633e29f99bd9e14a30865b7d2fcbe84 # v1.5.0 | |
with: | |
args: --latest --strip all | |
output: "CHANGELOG.md" | |
- name: Create Release | |
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 | |
with: | |
bodyFile: "CHANGELOG.md" | |
name: ${{ env.VERSION }} | |
prerelease: ${{ contains(github.ref_name, '-') }} |