Skip to content

Commit

Permalink
[#517] Create projects with main branch (#518)
Browse files Browse the repository at this point in the history
* [#517] Create projects with main branch

Resolves #517

* Use git 2.28 and initial-branch=main
  • Loading branch information
vrom911 authored Nov 6, 2020
1 parent b56aada commit 58893f9
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 65 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
push:
branches: [master]
branches: [main]

jobs:
build:
Expand All @@ -21,7 +21,7 @@ jobs:

steps:
- uses: actions/checkout@v2.3.3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: actions/setup-haskell@v1.1.3
name: Setup Haskell
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ The changelog is available [on GitHub][2].
Improve generated files content.
* [#491](https://github.com/kowainik/summoner/issues/491):
Support GHC-8.8.4 in the project.
* [#517](https://github.com/kowainik/summoner/issues/517):
Switch to `main` initial branch when creating project.
* Require `git >= 2.28` for `--initial-branch=main` option.

## 2.0.1.1 — May 29, 2020

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

[![GitHub CI](https://github.com/kowainik/summoner/workflows/CI/badge.svg)](https://github.com/kowainik/summoner/actions)
[![Build](https://img.shields.io/travis/kowainik/summoner.svg?logo=travis)](http://travis-ci.org/kowainik/summoner)
[![Windows build](https://ci.appveyor.com/api/projects/status/github/kowainik/summoner?branch=master&svg=true)](https://ci.appveyor.com/project/kowainik/summoner)
[![Windows build](https://ci.appveyor.com/api/projects/status/github/kowainik/summoner?branch=main&svg=true)](https://ci.appveyor.com/project/kowainik/summoner)

[![Hackage](https://img.shields.io/hackage/v/summoner.svg?logo=haskell)](https://hackage.haskell.org/package/summoner)
[![Stackage Lts](http://stackage.org/package/summoner/badge/lts)](http://stackage.org/lts/package/summoner)
[![Stackage Nightly](http://stackage.org/package/summoner/badge/nightly)](http://stackage.org/nightly/package/summoner)
[![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](https://github.com/kowainik/summoner/blob/master/LICENSE)
[![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](https://github.com/kowainik/summoner/blob/main/LICENSE)

> _So many of our dreams at first seem impossible, then they seem improbable, and
> then, when we summon the will, they soon become inevitable._
Expand Down Expand Up @@ -82,18 +82,18 @@ By the way, Summoner operates as either CLI or TUI application, so you can choos

You can also see complete examples in the following folder:

* [`summon-cli/examples/`: Examples of scaffolded projects](https://github.com/kowainik/summoner/tree/master/summoner-cli/examples/)
* [`summon-cli/examples/`: Examples of scaffolded projects](https://github.com/kowainik/summoner/tree/main/summoner-cli/examples/)

The directory contains the following examples:

* [`cabal-minimal`](https://github.com/kowainik/summoner/tree/master/summoner-cli/examples/cabal-minimal):
* [`cabal-minimal`](https://github.com/kowainik/summoner/tree/main/summoner-cli/examples/cabal-minimal):
Minimal Haskell project with the Cabal-only support, default
settings and all of the integrations disabled.
* [`cabal-full`](https://github.com/kowainik/summoner/tree/master/summoner-cli/examples/cabal-full):
* [`cabal-full`](https://github.com/kowainik/summoner/tree/main/summoner-cli/examples/cabal-full):
Cabal-only project with all integrations enabled.
* [`stack-full`](https://github.com/kowainik/summoner/tree/master/summoner-cli/examples/stack-full):
* [`stack-full`](https://github.com/kowainik/summoner/tree/main/summoner-cli/examples/stack-full):
Stack-only project with all integrations enabled.
* [`full-batteries`](https://github.com/kowainik/summoner/tree/master/summoner-cli/examples/full-batteries):
* [`full-batteries`](https://github.com/kowainik/summoner/tree/main/summoner-cli/examples/full-batteries):
All batteries-included project which supports both build tools and
shows every Summoner feature.

Expand Down Expand Up @@ -231,7 +231,7 @@ project-name/

To start using Summoner make sure that you have the following tools installed on your machine:

* [`git`](https://git-scm.com) – to initialize the GitHub repo.
* [`git`](https://git-scm.com) ⩾ 2.28 – to initialize the GitHub repo.
* [`hub`](https://github.com/github/hub) – to upload the project to GitHub.
* [`curl`](https://curl.haxx.se) – to download licenses.

Expand Down Expand Up @@ -494,7 +494,7 @@ Here is the list of the options that can be configured to suit your needs. If op
You can create default configuration using the `summon config`
command. See [the default content here](summoner-cli/test/golden/summoner-default.toml).

For a real-life example of the configuration, see [the configuration for projects of the `Kowainik` organization](https://github.com/kowainik/org/blob/master/.summoner.toml).
For a real-life example of the configuration, see [the configuration for projects of the `Kowainik` organization](https://github.com/kowainik/org/blob/main/.summoner.toml).

### Command line arguments

Expand Down Expand Up @@ -789,8 +789,8 @@ If you'd like to take part in the development processes, here are a few things t

* Summoner is a multi-package project which has two packages inside: `summoner-cli` and `summoner-tui`. We are supporting the same functionality in both of them, so, if it's possible, you should add/change the code in both of the packages.
* Summoner uses the custom prelude [`relude`](https://github.com/kowainik/relude).
* We are using the [Kowainik style guide](https://github.com/kowainik/org/blob/master/style-guide.md#haskell-style-guide).
* To sum up, [here is the Contributing guide](https://github.com/kowainik/.github/blob/master/CONTRIBUTING.md#contributing-to-the-kowainik-repositories) we use across the repositories.
* We are using the [Kowainik style guide](https://kowainik.github.io/posts/2019-02-06-style-guide).
* To sum up, [here is the Contributing guide](https://github.com/kowainik/.github/blob/main/CONTRIBUTING.md#contributing-to-the-kowainik-repositories) we use across the repositories.
* This project is contributor-friendly, so be kind to other people working on the project.

### Dependencies
Expand Down Expand Up @@ -821,7 +821,7 @@ for Stack.

[[Back to the Table of Contents]](#structure)

Summoner uses the golden tests technique for assuring the correctness of the generated files. For this purpose, we have [the `golden` folder](https://github.com/kowainik/summoner/tree/master/summoner-cli/test/golden) with two sample projects to test against.
Summoner uses the golden tests technique for assuring the correctness of the generated files. For this purpose, we have [the `golden` folder](https://github.com/kowainik/summoner/tree/main/summoner-cli/test/golden) with two sample projects to test against.

To actually run tests you need to run:

Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ clone_depth: 5
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true

# build only master branch
# build only main branch
branches:
only:
- master
- main

platform:
- x86_64
Expand Down Expand Up @@ -53,4 +53,4 @@ deploy:
draft: true
on:
APPVEYOR_REPO_TAG: true
STACK_YAML: stack.yaml
STACK_YAML: stack.yaml
6 changes: 3 additions & 3 deletions summoner-cli/examples/cabal-full/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
push:
branches: [master]
branches: [main]

jobs:
cabal:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- uses: actions/checkout@v2.3.3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: actions/setup-haskell@v1.1.3
id: setup-haskell-cabal
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/cabal-full/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![GitHub CI](https://github.com/kowainik/cabal-full/workflows/CI/badge.svg)](https://github.com/kowainik/cabal-full/actions)
[![Build status](https://img.shields.io/travis/kowainik/cabal-full.svg?logo=travis)](https://travis-ci.com/kowainik/cabal-full)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/cabal-full?branch=master&svg=true)](https://ci.appveyor.com/project/kowainik/cabal-full)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/cabal-full?branch=main&svg=true)](https://ci.appveyor.com/project/kowainik/cabal-full)
[![Hackage](https://img.shields.io/hackage/v/cabal-full.svg?logo=haskell)](https://hackage.haskell.org/package/cabal-full)
[![BSD-3-Clause license](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](LICENSE)

Expand Down
4 changes: 2 additions & 2 deletions summoner-cli/examples/cabal-full/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ clone_depth: 5
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true

# build only master branch
# build only main branch
branches:
only:
- master
- main

platform:
- x86_64
Expand Down
8 changes: 4 additions & 4 deletions summoner-cli/examples/full-batteries/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
push:
branches: [master]
branches: [main]

jobs:
cabal:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:

steps:
- uses: actions/checkout@v2.3.3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: actions/setup-haskell@v1.1.3
id: setup-haskell-cabal
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:

steps:
- uses: actions/checkout@v2.3.3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: actions/setup-haskell@v1.1.3
name: Setup Haskell Stack
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/full-batteries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![GitHub CI](https://github.com/kowainik/full-batteries/workflows/CI/badge.svg)](https://github.com/kowainik/full-batteries/actions)
[![Build status](https://img.shields.io/travis/kowainik/full-batteries.svg?logo=travis)](https://travis-ci.com/kowainik/full-batteries)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/full-batteries?branch=master&svg=true)](https://ci.appveyor.com/project/kowainik/full-batteries)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/full-batteries?branch=main&svg=true)](https://ci.appveyor.com/project/kowainik/full-batteries)
[![Hackage](https://img.shields.io/hackage/v/full-batteries.svg?logo=haskell)](https://hackage.haskell.org/package/full-batteries)
[![Stackage Lts](http://stackage.org/package/full-batteries/badge/lts)](http://stackage.org/lts/package/full-batteries)
[![Stackage Nightly](http://stackage.org/package/full-batteries/badge/nightly)](http://stackage.org/nightly/package/full-batteries)
Expand Down
4 changes: 2 additions & 2 deletions summoner-cli/examples/full-batteries/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ clone_depth: 5
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true

# build only master branch
# build only main branch
branches:
only:
- master
- main

platform:
- x86_64
Expand Down
6 changes: 3 additions & 3 deletions summoner-cli/examples/stack-full/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
push:
branches: [master]
branches: [main]

jobs:
stack:
Expand All @@ -21,7 +21,7 @@ jobs:

steps:
- uses: actions/checkout@v2.3.3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: actions/setup-haskell@v1.1.3
name: Setup Haskell Stack
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/stack-full/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![GitHub CI](https://github.com/kowainik/stack-full/workflows/CI/badge.svg)](https://github.com/kowainik/stack-full/actions)
[![Build status](https://img.shields.io/travis/kowainik/stack-full.svg?logo=travis)](https://travis-ci.com/kowainik/stack-full)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/stack-full?branch=master&svg=true)](https://ci.appveyor.com/project/kowainik/stack-full)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/kowainik/stack-full?branch=main&svg=true)](https://ci.appveyor.com/project/kowainik/stack-full)
[![Hackage](https://img.shields.io/hackage/v/stack-full.svg?logo=haskell)](https://hackage.haskell.org/package/stack-full)
[![Stackage Lts](http://stackage.org/package/stack-full/badge/lts)](http://stackage.org/lts/package/stack-full)
[![Stackage Nightly](http://stackage.org/package/stack-full/badge/nightly)](http://stackage.org/nightly/package/stack-full)
Expand Down
4 changes: 2 additions & 2 deletions summoner-cli/examples/stack-full/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ clone_depth: 5
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true

# build only master branch
# build only main branch
branches:
only:
- master
- main

environment:
STACK_ROOT: C:\sr
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/summoner-default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ license = "MIT"
# List of additional files to add after creating the project
# files =
# [ { path = ".stylish-haskell.yaml"
# , url = "https://raw.githubusercontent.com/kowainik/org/master/.stylish-haskell.yaml"
# , url = "https://raw.githubusercontent.com/kowainik/org/main/.stylish-haskell.yaml"
# }
# , { path = ".github/CODEOWNERS"
# , raw = "* @kowainik"
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/src/Summoner/Default.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ defaultConfigFileContent = unlines
, "# List of additional files to add after creating the project"
, "# files ="
, "# [ { path = " <> quote ".stylish-haskell.yaml"
, "# , url = " <> quote "https://raw.githubusercontent.com/kowainik/org/master/.stylish-haskell.yaml"
, "# , url = " <> quote "https://raw.githubusercontent.com/kowainik/org/main/.stylish-haskell.yaml"
, "# }"
, "# , { path = " <> quote ".github/CODEOWNERS"
, "# , raw = " <> quote ("* @" <> defaultOwner)
Expand Down
6 changes: 4 additions & 2 deletions summoner-cli/src/Summoner/Project.hs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ createProjectDirectory settings@Settings{..} = do
doGithubCommands :: Settings -> IO ()
doGithubCommands Settings{..} = do
-- Create git repostitory and do a commit.
"git" ["init"]
"git" ["init", "--initial-branch=main"]
"git" ["add", "."]
"git" ["commit", "-m", "Create the project"]
unless settingsNoUpload $ do
Expand All @@ -296,7 +296,9 @@ doGithubCommands Settings{..} = do
Just _ -> do
isHubSuccess <- runHub repo
if isHubSuccess
then "git" ["push", "-u", "origin", "master"]
then do
"git" ["push", "-u", "origin", "main"]
"git" ["remote", "set-head", "origin", "-a"]
else do
warningMessage "Error running 'hub'. Possible reason: incorrect password."
hubHelp repo
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/src/Summoner/Template/Doc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ docFiles Settings{..} =

appVeyorCom, appVeyorShield, appVeyorLink, appVeyorBadge :: Text
appVeyorCom = "https://ci.appveyor.com/"
appVeyorShield = appVeyorCom <> "api/projects/status/github/" <> ownerRepo <> "?branch=master&svg=true"
appVeyorShield = appVeyorCom <> "api/projects/status/github/" <> ownerRepo <> "?branch=main&svg=true"
appVeyorLink = appVeyorCom <> "project/" <> ownerRepo
appVeyorBadge = makeBadge "Windows build status" appVeyorShield appVeyorLink

Expand Down
Loading

0 comments on commit 58893f9

Please sign in to comment.