diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index da398c6..afba6ad 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -46,11 +46,10 @@ jobs: echo "pod_version=$POD_VERSION" >> $GITHUB_OUTPUT if [ "${{ github.ref }}" == "refs/heads/main" ]; then - echo "PRERELEASE=false" >> $GITHUB_ENV + echo "prerelease=false" >> $GITHUB_OUTPUT else - echo "PRERELEASE=true" >> $GITHUB_ENV + echo "prerelease=true" >> $GITHUB_OUTPUT fi - echo "prerelease=$PRERELEASE" >> $GITHUB_OUTPUT - name: Log job outputs run: | @@ -329,7 +328,7 @@ jobs: clojars: name: Publish to Clojars if: ${{ github.event_name != 'pull_request' }} - # needs: [linux, macos, windows] # publish only when all tests on all platforms pass + needs: [linux, macos, windows] # publish only when all tests on all platforms pass runs-on: ubuntu-latest steps: @@ -448,9 +447,7 @@ jobs: id: github_release with: body: | - This is a release of **${{ env.POD_NAME }}** version `${{ env.POD_VERSION }}`. - - The pod is also [published as an uberjar to Clojars](https://clojars.org/com.github.jackdbd/pod.jackdbd.jsoup). + 📦 **${{ env.POD_NAME }}** version `${{ env.POD_VERSION }}` is [available on Clojars](https://clojars.org/com.github.jackdbd/pod.jackdbd.jsoup/versions/${{ env.POD_VERSION }}). # draft: true fail_on_unmatched_files: true files: | diff --git a/bb.edn b/bb.edn index 2ecf43b..eb51ed6 100644 --- a/bb.edn +++ b/bb.edn @@ -68,8 +68,13 @@ ;; bb snapshot [patch|minor|major] :task (tasks/snapshot (keyword (first *command-line-args*)))} - stable {:doc "Promote the current SNAPSHOT version to stable" - :task (tasks/stable)} + stable + {:doc "Promote the current SNAPSHOT version to stable" + :task (tasks/stable)} + + sync-tags + {:doc "Run git fetch --force on all v*.*.*-SNAPSHOT tags" + :task (tasks/fetch-force-snapshot-tags)} test {:doc "Run all tests" diff --git a/bb/tasks.bb b/bb/tasks.bb index 4bfde4c..3fce5b8 100644 --- a/bb/tasks.bb +++ b/bb/tasks.bb @@ -8,7 +8,6 @@ (defn print-classpath [] (println "=== CLASSPATH BEGIN ===") - ;; (System/getProperty "java.class.path") (doseq [path (set (split-classpath (get-classpath)))] (println path)) (println "=== CLASSPATH END ===")) @@ -52,6 +51,17 @@ (shell ["git" "tag" "-a" (format "v%s" stable-version) "--message" message]) (shell (format "git push --atomic"))))) +(defn fetch-force-snapshot-tags [] + (let [remote-tags (->> (sh "git" "ls-remote" "--tags" "origin") + :out + str/split-lines + (map #(second (str/split % #"\s+"))) + (filter #(re-find #"v\d+\.\d+\.\d+-SNAPSHOT" %)))] + (doseq [tag remote-tags] + (let [tag-name (last (str/split tag #"/"))] + (println "Fetching and force updating tag:" tag-name) + (sh "git" "fetch" "origin" "tag" tag-name "--force"))))) + (comment (print-classpath) )