Skip to content

Commit

Permalink
More new project blues (#4)
Browse files Browse the repository at this point in the history
* More fixing bits and bobs

* Not sure what is mad about

* More facepalming

* Perms

* Always run tests
  • Loading branch information
UnstoppableMango authored Jan 13, 2024
1 parent 51a7ec2 commit ad434df
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ root = true
[*]
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.fs]
indent_style = space
fsharp_newline_before_multiline_computation_expression = false

[*.yml]
indent_style = space
indent_size = 2
31 changes: 16 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Build, Test, and Publish

on:
push:
branches: ['main']
pull_request:
branches: ['main']
push:
branches: ['main']
tags: ['v*.*.*']

jobs:
jobs:
build:
runs-on: ubuntu-latest
steps:
Expand All @@ -20,35 +20,33 @@ jobs:
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Restore tools
if: github.event_name == 'pull_request'
run: dotnet tool restore

- name: Restore dependencies
run: dotnet restore --locked-mode

- name: Build solution
run: dotnet build -c Release --no-restore

- name: Run tests
if: github.event_name == 'pull_request'
run: dotnet test -c Release --collect:"XPlat Code Coverage" --no-build

- name: Upload coverage reports to Codecov
if: github.event_name == 'pull_request'
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Lint solution
if: github.event_name == 'pull_request'
run: dotnet fantomas --check src

- name: Package library
if: github.event_name == 'push'
run: dotnet pack src/CliWrap.FSharp -c Release -o out --no-build

- name: Upload artifact
id: upload
if: github.event_name == 'push'
Expand All @@ -57,8 +55,8 @@ jobs:
name: nuget
path: out/*.nupkg
if-no-files-found: error
outputs:

outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}

publish:
Expand All @@ -70,6 +68,8 @@ jobs:
source: ['nuget', 'github']
env:
PACKAGE_PATTERN: UnMango.CliWrap.FSharp.*.nupkg
permissions:
packages: write
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -90,7 +90,8 @@ jobs:
--username ${{ github.repository_owner }} \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text \
--name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
--name github \
"https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: Publish to GitHub Packages
if: matrix.source == 'github'
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<Authors>UnstoppableMango</Authors>
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageProjectUrl>https://github.com/UnstoppableMango/CliWrap.FSharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/UnstoppableMango/CliWrap.FSharp</RepositoryUrl>
Expand Down

0 comments on commit ad434df

Please sign in to comment.