add CI, make age check non prime only #1
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: .NET Build and Release | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- dev | |
pull_request: | |
branches: | |
- main | |
- master | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: mcr.microsoft.com/dotnet/nightly/sdk:8.0 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Restore dependencies | |
run: dotnet restore ./src/KitsuneSteamRestrict.csproj | |
- name: Build | |
run: dotnet publish --configuration Release ./src/KitsuneSteamRestrict.csproj | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: net8.0-artifacts | |
path: | | |
src/bin/KitsuneSteamRestrict* | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: net8.0-artifacts | |
path: bin/Debug/net8.0 | |
- name: Archive | |
run: cd /home/runner/work/CS2-SteamRestrict/CS2-SteamRestrict/bin/Debug/net8.0 && zip /home/runner/work/CS2-SteamRestrict/CS2-SteamRestrict/SteamRestrict.zip ./* -r | |
- name: Create Tag | |
id: tag_version | |
run: | | |
DATE=$(date +'%y.%m.%d-%H%M%S') | |
echo "RELEASE_TAG=$DATE" >> $GITHUB_ENV | |
- name: Determine if Pre-release | |
id: prerelease | |
run: | | |
if [ "${{ github.ref }}" != "refs/heads/main" ]; then | |
echo "IS_PRERELEASE=true" >> $GITHUB_ENV | |
else | |
echo "IS_PRERELEASE=false" >> $GITHUB_ENV | |
fi | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.RELEASE_TAG }} | |
files: SteamRestrict.zip | |
prerelease: ${{ env.IS_PRERELEASE }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |