Skip to content

Commit c97f941

Browse files
fix: Solve CI publish issue (#157)
* doc: Add workflow diagram * Stop workflow if HTTP request fails * chore: Test publish execution with branch push * chore: Remove TODOs * doc: Update Changelog and cabal version for new release * doc: Update README * doc: Update README with new badge * doc: Update README for GH Actions workflow * feat: Short -x for --example
1 parent 4d7aab2 commit c97f941

File tree

7 files changed

+39
-6
lines changed

7 files changed

+39
-6
lines changed

.github/workflows/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# CI Workflows
2+
3+
## Overview
4+
5+
- [Build](build.yml)
6+
- Build and test Haskell code
7+
- [Draft](draft.yml)
8+
- Create a GH draft release with a static binary
9+
- [Release](release.yml)
10+
- Upload the package and docs to Hackage (release candidate)
11+
12+
## Events
13+
14+
```mermaid
15+
graph LR
16+
event[GH Event]-->|on push|Build
17+
event-->|tag created|Draft
18+
Draft-->|create draft release|End
19+
event-->|release published|Release
20+
Release-->|upload artifacts to Hackage (release candidate)|End
21+
Build-->End
22+
```

.github/workflows/publish.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ jobs:
3535
run: |
3636
SDIST_PATH=$(ls dist-newstyle/sdist/dotenv-*.tar.gz)
3737
curl -X POST \
38+
--fail -i \
3839
-H 'Accept: text/plain' \
39-
-H "Authorization: X-ApiKey \"$HACKAGE_API_KEY\"" \
40+
-H "Authorization: X-ApiKey ${HACKAGE_API_KEY}" \
4041
--form "package=@${SDIST_PATH}" \
4142
"https://hackage.haskell.org/packages/candidates"
4243
@@ -51,8 +52,9 @@ jobs:
5152
VERSION=${TAG_VERSION:1}
5253
DOCS_PATH=$(ls dist-newstyle/dotenv-*-docs.tar.gz)
5354
curl -X PUT \
55+
--fail -i \
5456
-H 'Content-Type: application/x-tar' \
5557
-H 'Content-Encoding: gzip' \
56-
-H "Authorization: X-ApiKey \"$HACKAGE_API_KEY\"" \
58+
-H "Authorization: X-ApiKey ${HACKAGE_API_KEY}" \
5759
--data-binary "@${DOCS_PATH}" \
5860
"https://hackage.haskell.org/package/dotenv-$VERSION/candidate/docs"

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
## MASTER
2+
## Dotenv 0.10.1.0
3+
### Added
4+
* Short `-x` for `--example` flag
5+
6+
### Modified
7+
* Fix `union`/`unionBy` bug, refactor .env.example check, and improve error
8+
message (Kudos to @pbrisbin)
9+
210
## Dotenv 0.10.0.1
311
### Modified
412
* Modify docs.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://github.com/stackbuilders/dotenv-hs/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/stackbuilders/dotenv-hs/actions/workflows/build-and-test.yml) [![Hackage](https://img.shields.io/hackage/v/dotenv.svg)](http://hackage.haskell.org/package/dotenv)
1+
[![Build Status](https://github.com/stackbuilders/dotenv-hs/actions/workflows/build.yml/badge.svg)](https://github.com/stackbuilders/dotenv-hs/actions/workflows/build.yml)[![Hackage](https://img.shields.io/hackage/v/dotenv.svg)](http://hackage.haskell.org/package/dotenv)
22

33
# Dotenv files for Haskell
44

@@ -161,7 +161,7 @@ $ echo $FOO
161161
This will fail:
162162
```shell
163163
$ dotenv -f .env --example .env.example "myprogram --myflag myargument"
164-
> dotenv: Missing env vars! Please, check (this/these) var(s) (is/are) set: BAR
164+
> dotenv: The following variables are present in .env.example, but not set in the current environment, or .env: BAR
165165
```
166166

167167
This will succeed:

app/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ config = Options
6262

6363
<*> many (strOption (
6464
long "example"
65+
<> short 'x'
6566
<> metavar "DOTENV_EXAMPLE"
6667
<> help "File to read for needed environmental variables" ))
6768

dotenv.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: dotenv
2-
version: 0.10.0.1
2+
version: 0.10.1.0
33
synopsis: Loads environment variables from dotenv files
44
homepage: https://github.com/stackbuilders/dotenv-hs
55
description:

src/Configuration/Dotenv.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ loadFile config@Config {..} = do
7979
else error $ concat
8080
[ "The following variables are present in "
8181
, showPaths "one of " envExamples
82-
, ", but not set in the current environment, or"
82+
, ", but not set in the current environment, or "
8383
, showPaths "any of " envs
8484
, ": "
8585
, intercalate ", " missingKeys

0 commit comments

Comments
 (0)