Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change dev instructions and CI #593

Merged
merged 12 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and test

on:
push:
pull_request:

env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true

# Kill other jobs when we trigger this workflow by sending new commits
# to the PR.
# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
7.x
8.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release
18 changes: 6 additions & 12 deletions .github/workflows/build.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: .NET Core
name: Publish

on:
push:
pull_request:
release:
types:
- published
Expand All @@ -22,15 +20,9 @@ env:
NUGET_FEED: https://api.nuget.org/v3/index.json
NUGET_KEY: ${{ secrets.NUGET_KEY }}

# Kill other jobs when we trigger this workflow by sending new commits
# to the PR.
# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build the project
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -66,8 +58,9 @@ jobs:
path: ./src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg

prerelease:
name: Publish a pre-release version
needs: build
if: github.ref == 'refs/heads/develop'
if: github.event.release.prerelease == true
runs-on: ubuntu-latest
steps:
- name: Download Artifact
Expand All @@ -82,8 +75,9 @@ jobs:
done

deploy:
name: Publish a release version
needs: build
if: github.event_name == 'release'
if: github.event.release.prerelease == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
29 changes: 11 additions & 18 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# DEVGUIDE

This used as a guide for maintainers and developers for building and release this project
This documentation must be used as a guide for maintainers and developers for building and releasing this project.

## Release Process

1. checkout `develop` branch
1. `git checkout develop`
1. Checkout `master` branch
1. `git checkout master`
2. Add a new entry at the top of the RELEASE_NOTES.md with a version and a date.
1. If possible link to the relevant issues and PRs and credit the author of the PRs
3. Create a new commit
Expand All @@ -14,24 +14,17 @@ This used as a guide for maintainers and developers for building and release thi
4. Make a new tag
1. `git tag v6.0.0-beta001`
5. Push changes
1. `git push --atomic origin develop v6.0.0-beta001`
6. Create a [new release](https://github.com/giraffe-fsharp/Giraffe/releases) on GitHub
1. `git push --atomic origin master v6.0.0-beta001`
6. Create a [new pre-release](https://github.com/giraffe-fsharp/Giraffe/releases) on GitHub
1. Choose the tag you just pushed
2. Title the release the same as the version
3. Copy the release notes from RELEASE_NOTES.md
2. Title the pre-release the same as the version
3. Copy the pre-release notes from RELEASE_NOTES.md
4. This will trigger a github action to build and publish the nuget package
7. Do any additional testing or tell certain people to try it out
8. Once satisfied repeat the process for the `master` branch but without any alpha/beta/rc suffixes.
1. `git checkout master`
2. `git merge develop`
3. `git push`
4. Run through steps 2-6
9. Merge `master` back into `develop`
1. `git checkout develop`
2. `git merge master`
3. `git push`
10. Tell the internet about it
8. Once satisfied repeat the process but without any alpha/beta/rc suffixes.
1. Run through steps 2-6, creating a **release** instead of a pre-release
9. Tell the internet about it
1. Tweet about it
2. Post in F# Slack
3. Post in F# Discord
11. Celebrate 🎉
10. Celebrate 🎉
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Help and feedback is always welcome and pull requests get accepted.
### TL;DR

- First open an issue to discuss your changes
- After your change has been formally approved please submit your PR **against the develop branch**
- After your change has been formally approved please submit your PR **against the master branch**
- Please follow the code convention by examining existing code
- Add/modify the `README.md` as required
- Add/modify unit tests as required
Expand Down Expand Up @@ -257,25 +257,21 @@ let someHttpHandler : HttpHandler =

If you intend to add or change an existing `HttpHandler` then please update the `README.md` file to reflect these changes there as well. If applicable unit tests must be added or updated and the project must successfully build before a pull request can be accepted.

### Submit a pull request against develop
### Submit a pull request against master

The `develop` branch is the main and only branch which should be used for all pull requests. A merge into `develop` means that your changes are scheduled to go live with the very next release, which could happen any time from the same day up to a couple weeks (depending on priorities and urgency).
The `master` branch is the main and only branch which should be used for all pull requests. A merge into `master` means that your changes are scheduled to go live with the very next release, which could happen any time from the same day up to a couple weeks (depending on priorities and urgency).

Only pull requests which pass all build checks and comply with the general coding guidelines can be approved.

If you have any further questions please let me know.

You can file an [issue on GitHub](https://github.com/giraffe-fsharp/Giraffe/issues/new) or contact me via [https://dusted.codes/about](https://dusted.codes/about).
You can file an [issue on GitHub](https://github.com/giraffe-fsharp/Giraffe/issues/new), start a [discussion on GitHub](https://github.com/giraffe-fsharp/Giraffe/discussions), or contact me via [https://dusted.codes/about](https://dusted.codes/about).

## Nightly builds and NuGet feed
## NuGet feed

All official release packages are published to the official and public NuGet feed.

Nightly builds (builds from the `develop` branch) produce unofficial pre-release packages which can be pulled from the [project's NuGet feed on GitHub](https://github.com/orgs/giraffe-fsharp/packages).

These packages are being tagged with the Workflow's run number as the package version.

All other builds, such as builds triggered by pull requests produce a NuGet package which can be downloaded as an artifact from the individual GitHub action.
Builds triggered by pull requests produce a NuGet package which can be downloaded as an artifact from the individual GitHub action.

## Blog posts

Expand Down Expand Up @@ -308,6 +304,7 @@ If you have blogged about Giraffe, demonstrating a useful topic or some other ti
- [Getting Started with ASP.NET Core Giraffe](https://www.youtube.com/watch?v=HyRzsPZ0f0k&t=461s) (by Ody Mbegbu)
- [Nikeza - Building the Backend with F#](https://www.youtube.com/watch?v=lANg1kn835s) (by Let's Code .NET)
- [Build a Simple Web API with F# + Giraffe](https://www.youtube.com/watch?v=yDBpd07SdHE) (by HAMY LABS)
- [Pipeline-oriented programming - Scott Wlaschin - NDC Porto 2023](https://www.youtube.com/watch?v=ipceTuJlw-M) (by Scott Wlaschin)

## License

Expand Down