Skip to content

Initial commit

Initial commit #1

name: Create solution from template
on:
push:
branches:
master
jobs:
CreateSolution:
runs-on: ubuntu-latest
steps:
- name: Get LibraryInitializer App token
id: get-token
uses: navikt/github-app-token-generator@v1
with:
app-id: ${{ secrets.LibraryInitializerAppId }}
private-key: ${{ secrets.LibraryInitializerAppSecret }}
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ steps.get-token.outputs.token }}
ref: ${{ github.head_ref }}
- name: Check there is only one commit
run: "[[ `git rev-list --all --count` == 1 ]] || exit 1"
- uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
- name: Install template
run: dotnet new --install Staticsoft.Template.Library
- name: Create solution
run: dotnet new staticsoft-lib -n ${{ github.event.repository.name }}
- name: Delete conflicting directories
run: rm -rf .github
- name: Move library files to root directory
run: mv ${{ github.event.repository.name }}/{.[!.],}* .
- name: Remove empty directory
run: rmdir ${{ github.event.repository.name }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Created solution from library template"