33
.github/workflows/build.yml
vendored
33
.github/workflows/build.yml
vendored
@@ -1,31 +1,26 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
- master
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release
|
||||
|
||||
- name: Test
|
||||
run: dotnet test --configuration Release --no-build
|
||||
|
||||
- name: Upload artifacts
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release
|
||||
- name: Test
|
||||
run: dotnet test --configuration Release --no-build
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Build
|
||||
path: ${{ github.workspace }}
|
||||
path: ${{ github.workspace }}
|
||||
|
||||
57
.github/workflows/release.yml
vendored
57
.github/workflows/release.yml
vendored
@@ -1,38 +1,35 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
- name: Verify commit exists in origin/master
|
||||
run: >
|
||||
git fetch --no-tags --prune --depth=1 origin
|
||||
+refs/heads/*:refs/remotes/origin/*
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
- name: Verify commit exists in origin/master
|
||||
run: |
|
||||
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
||||
git branch --remote --contains | grep origin/master
|
||||
|
||||
- name: Set VERSION variable from tag
|
||||
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release /p:Version=${VERSION}
|
||||
|
||||
- name: Test
|
||||
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
|
||||
|
||||
- name: Pack
|
||||
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
|
||||
|
||||
- name: Push
|
||||
run: dotnet nuget push CSSUDII.Sodium.Interop.${VERSION}.nupkg --source https://nexus.119.224.65.18.sslip.io/repository/nuget/index.json --api-key ${GITHUB_TOKEN}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
git branch --remote --contains | grep origin/master
|
||||
- name: Set VERSION variable from tag
|
||||
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release /p:Version=${VERSION}
|
||||
- name: Test
|
||||
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
|
||||
- name: Pack
|
||||
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build
|
||||
--output .
|
||||
- name: Push
|
||||
run: dotnet nuget push CSSUDII.Sodium.Interop.${VERSION}.nupkg --source
|
||||
https://nexus.119.224.65.18.sslip.io/repository/nuget/index.json
|
||||
--api-key ${GITHUB_TOKEN}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user