Skip to content

Commit

Permalink
Merge pull request #17 from Cysharp/feature/actions
Browse files Browse the repository at this point in the history
feat: use Cysharp/Actions reusable workflows/actions
  • Loading branch information
guitarrapc authored Jul 25, 2022
2 parents e8812d4 + 57fc592 commit 7afa840
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 41 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/build-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,17 @@ on:
push:
branches:
- "master"
tags:
- "!*" # not a tag push
pull_request:
branches:
- master

jobs:
build-dotnet:
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- uses: actions/checkout@v3
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
with:
dotnet-version: |
5.0.x
Expand Down
28 changes: 11 additions & 17 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,49 @@ on:
tag:
description: "tag: git tag you want create. (sample 1.0.0)"
required: true
dry_run:
description: "dry_run: true will never create release/nuget."
dry-run:
description: "dry-run: true will never create release/nuget."
required: true
default: "false"

env:
GIT_TAG: ${{ github.event.inputs.tag }}
DRY_RUN: ${{ github.event.inputs.dry_run }}
DRY_RUN: ${{ github.event.inputs.dry-run }}

jobs:
build-dotnet:
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- uses: actions/checkout@v3
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
with:
dotnet-version: |
5.0.x
6.0.x
# pack nuget
- run: dotnet build -c Release -p:Version=${{ env.GIT_TAG }}
- run: dotnet test -c Release --no-build -p:Version=${{ env.GIT_TAG }}
- run: dotnet pack ./src/LitJWT/LitJWT.csproj -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish
- run: dotnet pack -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish
- uses: actions/upload-artifact@v2
with:
name: nuget
path: ./publish

create-release:
if: github.event.inputs.dry_run == 'false'
if: github.event.inputs.dry-run == 'false'
needs: [build-dotnet]
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
timeout-minutes: 10
steps:
# setup dotnet for nuget push
- uses: actions/setup-dotnet@v1
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
with:
dotnet-version: |
5.0.x
6.0.x
# tag
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: tag
run: git tag ${{ env.GIT_TAG }}
- name: Push changes
Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
name: "Close stale issues"

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# enable issue
stale-issue-message: "This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days."
stale-issue-label: "stale"
# enable pr
stale-pr-message: "This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days."
stale-pr-label: "stale"
days-before-stale: 90
days-before-close: 7
exempt-issue-labels: "wip"
exempt-pr-labels: "wip"
remove-stale-when-updated: true
uses: Cysharp/Actions/.github/workflows/stale-issue.yaml@main
1 change: 1 addition & 0 deletions sandbox/Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions sandbox/ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/LitJWT/LitJWT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>jwt, auth</PackageTags>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework) == 'netstandard2.1'">
Expand Down
1 change: 1 addition & 0 deletions tests/LitJWT.Tests/LitJWT.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>opensource.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 7afa840

Please sign in to comment.