Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Only release on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kipz committed Feb 6, 2023
1 parent a8ef14e commit 26cda18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release

on:
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
releases-matrix:
Expand All @@ -26,6 +26,6 @@ jobs:
goarch: ${{ matrix.goarch }}
goversion: 1.19.1
binary_name: "pod-atomisthq-tools.docker"
release_tag: v0.${{ github.run_number }}.${{ github.run_attempt }}
release_tag: ${{github.ref_name}}
overwrite: TRUE
compress_assets: OFF
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Background

This is a [babashka pod](https://github.com/babashka/pods) that binds some golang functions into a clojure namespace. Using this pod, clojure programs can parse dockerfiles and docker images names using the "official" docker golang libraries.
This is a [babashka pod](https://github.com/babashka/pods) that binds some golang functions into a clojure namespace. Using this pod, clojure programs can parse dockerfiles and docker images names using the "official" docker golang libraries.

* [`github.com/docker/distribution/reference`](https://github.com/distribution/distribution/blob/main/reference/reference.go) (for image name parsing)
* [`github.com/moby/buildkit/frontend/dockerfile/parser`](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/parser/parser.go) (for generating a Dockerfile AST).
Expand All @@ -16,13 +16,13 @@ This is a [babashka pod](https://github.com/babashka/pods) that binds some golan
;; load-pod will create this namespace with two vars
(require '[pod.atomisthq.docker :as docker])

;; parse image names using github.com/docker/distribution
;; parse image names using github.com/docker/distribution
;; turns golang structs into clojure maps
(docker/parse-image-name "gcr.io/whatever:tag")
(docker/parse-image-name "gcr.io/whatever:tag")
;; automatically turns golang errors into Exceptions
(try
(docker/parse-image-name "gcr.io/whatever/:tag")
(catch Exception e
(catch Exception e
;; invalid reference format
(println (.getMessage e))))

Expand All @@ -47,6 +47,10 @@ Create `vonwig/pod-atomisthq-tools.docker` which is a manifest list with pod bin
bb build-pod-image
```

## Releasing

Pushing a tag (like v0.1.1) will cause a GitHub release to be created

## Namespace generation

The `pods/load-pod` call is convenient for a repl-session, or a script, but what if you are `aot` compiling, or building a native binary. In the example above, the namespaces emitted by `pods/load-pod` are not available until runtime.
Expand Down Expand Up @@ -83,8 +87,8 @@ Here is an example of bindings that will resolve at compile-time and go through

;; async example
(defn generate-sbom [s]
(impl/invoke-public "pod.atomisthq.docker" "pod.atomisthq.docker/-generate-sbom"
[s cb]
(impl/invoke-public "pod.atomisthq.docker" "pod.atomisthq.docker/-generate-sbom"
[s cb]
{:handlers {:done (fn [])
:success cb
:error (fn [err]}})))
Expand Down

0 comments on commit 26cda18

Please sign in to comment.