Skip to content

Commit

Permalink
Merge pull request #17 from ckipp01/env
Browse files Browse the repository at this point in the history
fix: update usage of env related things
  • Loading branch information
ckipp01 authored Aug 31, 2022
2 parents 06dd90a + cbd5b46 commit 79e2ed0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- run: ./mill -i -j 0 io.kipp.mill.ci.release.ReleaseModule/publishAll
- run: ./mill -i io.kipp.mill.ci.release.ReleaseModule/publishAll
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ override def sonatypeSnapshotUri =
"https://s01.oss.sonatype.org/content/repositories/snapshots"
```

#### It's publishing a 0.0.0-something-SNAPSHOT even though I have a git tag

If you see this it's probably because you forgot to add the `fetch-depth` in
checkout, meaning that no git tags are getting pulled in CI:

```yaml
- uses: actions/checkout@v3
with:
fetch-depth: 0
```

## Notes

This plugin has only really been tested on more minimal projects. There is
Expand Down
12 changes: 6 additions & 6 deletions plugin/src/io/kipp/mill/ci/release/CiReleaseModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ object ReleaseModule extends ExternalModule {
* a Env Task
*/
private def setupEnv(): Task[Env] = T.input {
val pgpSecret = Option(System.getenv("PGP_SECRET"))
val pgpPassword = Option(System.getenv("PGP_PASSPHRASE"))
val isTag =
Option(System.getenv("GITHUB_REF")).exists(_.startsWith("refs/tags"))
val sonatypeUser = Option(System.getenv("SONATYPE_USERNAME"))
val sonatypePassword = Option(System.getenv("SONATYPE_PASSWORD"))
val env = T.ctx().env
val pgpSecret = env.get("PGP_SECRET")
val pgpPassword = env.get("PGP_PASSPHRASE")
val isTag = env.get("GITHUB_REF").exists(_.startsWith("refs/tags"))
val sonatypeUser = env.get("SONATYPE_USERNAME")
val sonatypePassword = env.get("SONATYPE_PASSWORD")

if (pgpSecret.isEmpty) {
Result.Failure("Missing PGP_SECRET. Make sure you have it set.")
Expand Down

0 comments on commit 79e2ed0

Please sign in to comment.