Skip to content

Release

Release #18

Workflow file for this run

name: "Release"
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *" # First day of every month
jobs:
cache-job:
name: "Cache source code"
runs-on: ubuntu-latest
steps:
- name: "Clone Git repository"
uses: actions/checkout@master
- name: "Cache files for release"
id: cache
uses: actions/cache@v3
with:
path: "./gitignore" # We don't actually care about what gets in this cache, just the key
key: "cache-${{ hashFiles('src/**/*') }}-${{ hashFiles('ext/**/*') }}-${{ hashFiles('.github/**/*') }}"
lookup-only: true
- name: "Set cache environment variable"
shell: bash
run: echo "CACHE_HIT=${{ steps.cache.outputs.cache-hit }}" >> $GITHUB_ENV
build-job:
name: "Build"
needs: [cache-job]
if: ${{ env.CACHE_HIT != 'true' }}

Check failure on line 31 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 31, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.CACHE_HIT != 'true' .github/workflows/release.yml (Line: 38, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.CACHE_HIT != 'true'
uses: "./.github/workflows/build.yml"
release-job:
name: "Release .NET solution"
needs: [build-job]
runs-on: ubuntu-latest
if: ${{ env.CACHE_HIT != 'true' }}
steps:
- name: "Clone Git repository"
uses: actions/checkout@master
with:
submodules: "recursive"
- name: "Download native libraries (win-x64)"
uses: actions/download-artifact@v1
with:
name: "native-libraries-win-x64"
path: "./lib"
- name: "Download native libraries (osx)"
uses: actions/download-artifact@v1
with:
name: "native-libraries-osx"
path: "./lib"
- name: "Download native libraries (linux-x64)"
uses: actions/download-artifact@v1
with:
name: "native-libraries-linux-x64"
path: "./lib"
- name: ".NET pack"
run: dotnet pack "./src/cs" --nologo --verbosity minimal --configuration Release -p:PackageVersion="$(date +'%Y.%m.%d')" -p:RepositoryBranch="${{ github.head_ref || github.ref_name }}" -p:RepositoryCommit="${{ github.sha }}"
- name: "Upload packages to MyGet"
if: github.event_name == 'workflow_dispatch'
env:
MYGET_ACCESS_TOKEN: ${{ secrets.MYGET_ACCESS_TOKEN }}
run: dotnet nuget push "./nupkg/**/*.nupkg" --source https://www.myget.org/F/bottlenoselabs/api/v3/index.json --skip-duplicate --api-key $MYGET_ACCESS_TOKEN
- name: "Upload packages to NuGet"
if: github.event_name == 'schedule'
env:
NUGET_ACCESS_TOKEN: ${{ secrets.NUGET_ACCESS_TOKEN }}
run: dotnet nuget push "./nupkg/**/*.nupkg" --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key $NUGET_ACCESS_TOKEN