From ef5b83dfa507790be217c9db1261c806ff1dc912 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sat, 8 Jan 2022 02:19:47 +0000 Subject: [PATCH 1/4] Revert "Remove old workaround" This reverts commit 992d39be4b23d77075ad75f74c21c358b782ae41. --- .github/workflows/ci.yml | 4 ++-- .../typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b519f39..b248e372 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,5 +129,5 @@ jobs: echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) - - name: Publish project - run: sbt ++${{ matrix.scala }} +publish + - if: (startsWith(github.ref, 'refs/tags/v') && github.ref_type == 'tag') || (!startsWith(github.ref, 'refs/tags/v') && github.ref_type != 'tag') + run: sbt ++${{ matrix.scala }} release diff --git a/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala b/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala index d1184425..b8da23b5 100644 --- a/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala +++ b/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala @@ -57,6 +57,13 @@ object TypelevelSonatypeCiReleasePlugin extends AutoPlugin { tags ++ branches }, - githubWorkflowTargetTags += "v*" + githubWorkflowTargetTags += "v*", + githubWorkflowPublish := Seq( + WorkflowStep.Sbt( + List("release"), + cond = Some( // NEVER release a tag on a non-tag workflow run + "(startsWith(github.ref, 'refs/tags/v') && github.ref_type == 'tag') || (!startsWith(github.ref, 'refs/tags/v') && github.ref_type != 'tag')") + ) + ) ) } From 6610c34f884e8b0bcc633a3f28038c068a89a263 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sat, 8 Jan 2022 02:22:25 +0000 Subject: [PATCH 2/4] Remove workaround, and only workaround --- .github/workflows/ci.yml | 3 +-- .../typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b248e372..6c6faf06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,5 +129,4 @@ jobs: echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) - - if: (startsWith(github.ref, 'refs/tags/v') && github.ref_type == 'tag') || (!startsWith(github.ref, 'refs/tags/v') && github.ref_type != 'tag') - run: sbt ++${{ matrix.scala }} release + - run: sbt ++${{ matrix.scala }} release diff --git a/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala b/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala index b8da23b5..3c95379c 100644 --- a/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala +++ b/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala @@ -59,11 +59,7 @@ object TypelevelSonatypeCiReleasePlugin extends AutoPlugin { }, githubWorkflowTargetTags += "v*", githubWorkflowPublish := Seq( - WorkflowStep.Sbt( - List("release"), - cond = Some( // NEVER release a tag on a non-tag workflow run - "(startsWith(github.ref, 'refs/tags/v') && github.ref_type == 'tag') || (!startsWith(github.ref, 'refs/tags/v') && github.ref_type != 'tag')") - ) + WorkflowStep.Sbt(List("release")) ) ) } From 7437b6612ea8a4ceeabe369c95a3a8d77dd869cd Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sat, 8 Jan 2022 02:24:15 +0000 Subject: [PATCH 3/4] Don't need tag setting --- .../org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala b/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala index 3c95379c..11e4edb5 100644 --- a/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala +++ b/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala @@ -57,7 +57,6 @@ object TypelevelSonatypeCiReleasePlugin extends AutoPlugin { tags ++ branches }, - githubWorkflowTargetTags += "v*", githubWorkflowPublish := Seq( WorkflowStep.Sbt(List("release")) ) From 5f9a9a3a4b19fe93cedca49da88ccc270832553f Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sat, 8 Jan 2022 02:27:24 +0000 Subject: [PATCH 4/4] Revert "Don't need tag setting" This reverts commit 7437b6612ea8a4ceeabe369c95a3a8d77dd869cd. --- .../org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala b/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala index 11e4edb5..3c95379c 100644 --- a/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala +++ b/sonatype-ci-release/src/main/scala/org/typelevel/sbt/TypelevelSonatypeCiReleasePlugin.scala @@ -57,6 +57,7 @@ object TypelevelSonatypeCiReleasePlugin extends AutoPlugin { tags ++ branches }, + githubWorkflowTargetTags += "v*", githubWorkflowPublish := Seq( WorkflowStep.Sbt(List("release")) )