-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from steem-monsters/githubactions
add actions
- Loading branch information
Showing
6 changed files
with
213 additions
and
47 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ master ] | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'csharp' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: pull-request | ||
on: | ||
pull_request | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Bump version and push tag | ||
id: bump-and-tag | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
|
||
- name: version it | ||
id: get-id | ||
uses: actions/[email protected] | ||
env: | ||
DATA: ${{ steps.bump-and-tag.outputs.new_tag }} | ||
with: | ||
script: | | ||
const id = process.env.DATA.split('v')[1] | ||
core.setOutput('version', id) | ||
- name: output | ||
id: tag-and-version | ||
run: echo "Output tag = ${{ steps.bump-and-tag.outputs.new_tag }} parsed = ${{ steps.get-id.outputs.version }}" | ||
|
||
- name: Build | ||
run: dotnet build --no-restore -c Debug -p:Version=${{ steps.get-id.outputs.version }} | ||
|
||
- name: Test | ||
env: | ||
HIVEUSERNAME: ${{ secrets.USERNAME }} | ||
KEY: ${{ secrets.KEY }} | ||
run: dotnet test --no-build --verbosity normal | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Publish release to nuget | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
Nuget: | ||
runs-on: ubuntu-latest | ||
environment: test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- name: Setup .NET Core 6 | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 8.0.x | ||
env: | ||
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} | ||
|
||
- name: Bump version and push tag | ||
id: bump-and-tag | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
|
||
- name: version it | ||
id: get-id | ||
uses: actions/[email protected] | ||
env: | ||
DATA: ${{ steps.bump-and-tag.outputs.new_tag }} | ||
with: | ||
script: | | ||
const id = process.env.DATA.split('v')[1] | ||
core.setOutput('version', id) | ||
- name: Create releasse | ||
id: release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.bump-and-tag.outputs.new_tag }} | ||
release_name: Release ${{ steps.bump-and-tag.outputs.new_tag }} | ||
body: | | ||
Changes in this release | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Pack it | ||
run: dotnet pack -c Release --no-restore -p:Version=${{ steps.get-id.outputs.version }} -o out | ||
|
||
|
||
- name: Publish SplinterLands.DTOs | ||
run: nuget push ./**/SplinterLands.DTOs.*.nupkg -SkipDuplicate -NoSymbols -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }} | ||
|
||
- name: Publish SplinterLandsAPI | ||
run: nuget push ./**/SplinterLandsAPI.*.nupkg -SkipDuplicate -NoSymbols -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
This project makes use of the .net secrets manager in order to protect the login and key of the user used to validate tests that require a login. | ||
To setup the secrets manager first run `dotnet user-secrets init` from the project directory. | ||
|
||
Next add two secrets, one for the user `HIVEUSERNAME` and one for your private posting key `KEY`. | ||
|
||
`dotnet user-secrets set "HIVEUSERNAME" "YOUR_USER_NAME_HERE"` | ||
|
||
`dotnet user-secrets set "KEY" "YOUR_PRIVATE_POSTING_KEY_HERE"` | ||
|
||
See more info at https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-8.0&tabs=windows |
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
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