ArkProjects.EHentai.Api ci. again. #31
Workflow file for this run
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: push tags (nuget) | |
on: | |
push: | |
tags: | |
- '*-v*' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.nuget/packages | |
key: ${{runner.os}}-nuget | |
- name: env vars | |
env: | |
GIT_REF: ${{ github.ref_name }} | |
GIT_REF_TYPE: ${{ github.ref_type }} | |
GIT_COMMIT_SHA: ${{ github.sha }} | |
PROJECT_URL: ${{ github.server_url }}/${{ github.repository }} | |
REPO_URL: ${{ github.repositoryUrl }} | |
run: | | |
echo "GIT_REF=${GIT_REF}" >> ${GITHUB_ENV} | |
echo "GIT_REF_TYPE=${GIT_REF_TYPE}" >> ${GITHUB_ENV} | |
echo "GIT_COMMIT_SHA=${GIT_COMMIT_SHA}" >> ${GITHUB_ENV} | |
echo "PROJECT_URL=${PROJECT_URL}" >> ${GITHUB_ENV} | |
echo "REPO_URL=${REPO_URL}" >> ${GITHUB_ENV} | |
echo "PACKAGE=`echo "$GIT_REF" | sed -E 's|^([^ -]+).*|\1|1'`" >> ${GITHUB_ENV} | |
- name: Build | |
working-directory: ${{env.PACKAGE}} | |
run: dotnet build -c Release | |
- name: Test | |
working-directory: ${{env.PACKAGE}} | |
run: dotnet test -c Release --no-build --logger trx --results-directory "TestResults" | |
- name: Upload dotnet test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dotnet-results | |
path: ${{env.PACKAGE}}/TestResults | |
if: ${{always()}} | |
publish: | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.nuget/packages | |
key: ${{runner.os}}-nuget | |
- name: env vars | |
env: | |
GIT_REF: ${{ github.ref_name }} | |
GIT_REF_TYPE: ${{ github.ref_type }} | |
GIT_COMMIT_SHA: ${{ github.sha }} | |
PROJECT_URL: ${{ github.server_url }}/${{ github.repository }} | |
REPO_URL: ${{ github.repositoryUrl }} | |
run: | | |
echo "GIT_REF=${GIT_REF}" >> ${GITHUB_ENV} | |
echo "GIT_REF_TYPE=${GIT_REF_TYPE}" >> ${GITHUB_ENV} | |
echo "GIT_COMMIT_SHA=${GIT_COMMIT_SHA}" >> ${GITHUB_ENV} | |
echo "PROJECT_URL=${PROJECT_URL}" >> ${GITHUB_ENV} | |
echo "REPO_URL=${REPO_URL}" >> ${GITHUB_ENV} | |
echo "PACKAGE=`echo "$GIT_REF" | sed -E 's|^([^ -]+).*|\1|1'`" >> ${GITHUB_ENV} | |
- name: Pack | |
working-directory: ${{env.PACKAGE}} | |
run: dotnet pack -c Release -o ./out /p:NugetBuild=true /p:ContinuousIntegrationBuild=true $PACKAGE | |
- name: Dist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget_packages | |
path: ${{env.PACKAGE}}/out | |
if: ${{always()}} | |
- name: NugetPush | |
working-directory: ${{env.PACKAGE}} | |
env: | |
NUGET_KEY: ${{secrets.NUGET_KEY}} | |
run: dotnet nuget push ./out/$PACKAGE.*.nupkg --source nuget.org -k $NUGET_KEY |