Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-work github actions for deploy #212

Merged
merged 10 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 84 additions & 9 deletions .github/workflows/clojure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@ on:
branches: [ master ]

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- run: bb -m tasks.ci/setup
check:
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- run: bb check
test-clj:
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- run: bb -m tasks.test/clj
test-cljs:
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -38,27 +47,93 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/pwa-release/
force_orphan: true
deploy:
package:
runs-on: ubuntu-latest
needs: [ test-clj, test-cljs, check ]
if: startsWith(github.event.head_commit.message, 'Release ')
environment: deploy
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- id: info
run: bb -m tasks.info
- run: bb -m tasks.deploy
env:
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}
JETBRAINS_TOKEN: ${{ secrets.JETBRAINS_TOKEN }}
- run: bb pkg
- uses: actions/upload-artifact@v4
with:
name: jar
path: target/*.jar
- uses: actions/upload-artifact@v4
with:
name: extension-vscode
path: extension-vscode/*.vsix
- uses: actions/upload-artifact@v4
with:
name: extension-intellij
path: extension-intellij/build/distributions/*.zip
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.info.outputs.version }}
files: |
target/*.jar
extension-vscode/*.vsix
extension-intellij/build/distributions/*.zip
deploy-clojars:
runs-on: ubuntu-latest
needs: [ package ]
environment: deploy
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- uses: actions/download-artifact@v4
with:
name: jar
path: target/
- run: ls target/
- run: bb -m tasks.deploy/deploy-clojars
env:
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
deploy-vsx:
runs-on: ubuntu-latest
needs: [ package ]
environment: deploy
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- uses: actions/download-artifact@v4
with:
name: extension-vscode
path: extension-vscode/
- run: ls extension-vscode/
- run: bb -m tasks.deploy/deploy-vscode
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
deploy-open-vsx:
runs-on: ubuntu-latest
needs: [ package ]
environment: deploy
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- uses: actions/download-artifact@v4
with:
name: extension-vscode
path: extension-vscode/
- run: ls extension-vscode/
- run: bb -m tasks.deploy/deploy-open-vsx
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
deploy-intellij:
runs-on: ubuntu-latest
needs: [ package ]
environment: deploy
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- uses: actions/download-artifact@v4
with:
name: extension-intellij
path: extension-intellij/build/distributions/
- run: ls extension-intellij/build/distributions/
- run: bb -m tasks.deploy/deploy-intellij
env:
JETBRAINS_TOKEN: ${{ secrets.JETBRAINS_TOKEN }}
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
:shadow
{:jvm-opts ["-Xss16m"]
:extra-deps
{thheller/shadow-cljs {:mvn/version "2.27.4"}}}
{thheller/shadow-cljs {:mvn/version "2.27.4"}}}
:build
{:extra-paths ["src" "dev" "resources"]
:ns-default tasks.build
Expand Down
16 changes: 15 additions & 1 deletion dev/tasks/ci.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
(ns tasks.ci
(:require [tasks.check :refer [check check*]]
[tasks.test :refer [test test*]]))
[tasks.test :refer [test test*] :as test]
[tasks.tools :refer [clj]]))

(def ^:private commands
["-M:cljfmt"
"-M:cljs"
"-M:cljs:shadow"
"-M:dev"
"-M:kondo"
"-M:test"
"-X:deploy"])

(defn setup []
(test/setup)
(doseq [command commands] (clj "-Sforce" "-Spath" command)))

(defn ci
"Run all CI Checks."
Expand Down
9 changes: 9 additions & 0 deletions dev/tasks/test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
(install)
(cljs* (get-cljs-deps) :portal.test-ui-runner))

(defn- setup* [version]
(t/clj
"-Sforce" "-Spath" "-Sdeps"
(pr-str {:deps {'org.clojure/clojurescript {:mvn/version version}}})))

(defn setup []
(setup* "1.10.773")
(setup* "1.10.844"))

(defn cljs []
(cljs-runtime "1.10.773")
(cljs-runtime "1.10.844")
Expand Down
3 changes: 2 additions & 1 deletion dev/tasks/tools.clj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
{:out *out* :err *err*})))
start (now)
result @(if-let [f (get fns (first args))]
(f (map name (rest args)) opts)
(or (f (map name (rest args)) opts)
(atom {:exit 0}))
(p/process (map name args) opts))
exit (:exit result)]
(when-not (:inherit opts)
Expand Down
Loading