Skip to content

Commit 42c3464

Browse files
authored
rm mage (#29)
1 parent 0ed481f commit 42c3464

File tree

14 files changed

+325
-810
lines changed

14 files changed

+325
-810
lines changed

.github/workflows/ci.yaml

Lines changed: 123 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,62 +18,151 @@ on:
1818

1919
env:
2020
VAULT_ADDR: https://vault.eng.aserto.com/
21-
GO_VERSION: "1.22"
2221

2322
jobs:
2423
build:
2524
runs-on: ubuntu-latest
2625
steps:
27-
- name: Info
26+
-
27+
name: Read configuration
28+
uses: hashicorp/vault-action@v3
29+
id: vault
30+
with:
31+
url: ${{ env.VAULT_ADDR }}
32+
token: ${{ secrets.VAULT_TOKEN }}
33+
secrets: |
34+
kv/data/github "USERNAME" | GH_USERNAME;
35+
kv/data/github "READ_WRITE_TOKEN" | GH_TOKEN;
36+
kv/data/buf.build "ASERTO_BUF_USER" | BUF_USER;
37+
kv/data/buf.build "ASERTO_BUF_TOKEN" | BUF_TOKEN;
38+
kv/data/MavenCentral "USERNAME" | MAVEN_USERNAME;
39+
kv/data/MavenCentral "PASSWORD" | MAVEN_CENTRAL_TOKEN;
40+
kv/data/MavenCentral "GPG_PASSPHRASE" | MAVEN_GPG_PASSPHRASE;
41+
kv/data/MavenCentral "PRIVATE_GPG_KEY" | MAVEN_GPG_PRIVATE_KEY;
42+
kv/data/MavenCentral "TOKEN_USERNAME" | TOKEN_USERNAME;
43+
kv/data/MavenCentral "TOKEN_PASSWORD" | TOKEN_PASSWORD;
44+
-
45+
name: Info
2846
run: echo "Using proto ${{ github.event.inputs.proto_ref }} with sha ${{ github.event.inputs.proto_sha }}"
29-
30-
- name: Checkout
47+
-
48+
name: Checkout
3149
uses: actions/checkout@v4
3250
with:
3351
fetch-depth: 0
34-
35-
- name: Setup Go
36-
uses: actions/setup-go@v5
37-
with:
38-
go-version: ${{ env.GO_VERSION }}
39-
40-
- name: Install dependencies, update proto and build
41-
run: |
42-
go run mage.go all
43-
44-
- name: Commit changes
52+
-
53+
name: Install deps
54+
run: make deps
55+
-
56+
name: Clean Generated Code
57+
run: make clean-gen
58+
-
59+
name: Generate Code
60+
run: make buf-generate
61+
-
62+
name: Build
63+
run: make build
64+
-
65+
name: Commit changes
4566
if: github.event_name == 'workflow_dispatch'
4667
uses: EndBug/add-and-commit@v9
4768
with:
4869
default_author: github_actions
4970
add: 'pom.xml src'
5071
push: origin HEAD:main
51-
release:
72+
73+
test:
5274
runs-on: ubuntu-latest
5375
needs: build
76+
steps:
77+
-
78+
name: Read configuration
79+
uses: hashicorp/vault-action@v3
80+
id: vault
81+
with:
82+
url: ${{ env.VAULT_ADDR }}
83+
token: ${{ secrets.VAULT_TOKEN }}
84+
secrets: |
85+
kv/data/github "USERNAME" | GH_USERNAME;
86+
kv/data/github "READ_WRITE_TOKEN" | GH_TOKEN;
87+
kv/data/buf.build "ASERTO_BUF_USER" | BUF_USER;
88+
kv/data/buf.build "ASERTO_BUF_TOKEN" | BUF_TOKEN;
89+
kv/data/MavenCentral "USERNAME" | MAVEN_USERNAME;
90+
kv/data/MavenCentral "PASSWORD" | MAVEN_CENTRAL_TOKEN;
91+
kv/data/MavenCentral "GPG_PASSPHRASE" | MAVEN_GPG_PASSPHRASE;
92+
kv/data/MavenCentral "PRIVATE_GPG_KEY" | MAVEN_GPG_PRIVATE_KEY;
93+
kv/data/MavenCentral "TOKEN_USERNAME" | TOKEN_USERNAME;
94+
kv/data/MavenCentral "TOKEN_PASSWORD" | TOKEN_PASSWORD;
95+
-
96+
name: Checkout
97+
uses: actions/checkout@v4
98+
with:
99+
fetch-depth: 0
100+
-
101+
name: Set up Java for publishing to Maven Central Repository
102+
uses: actions/setup-java@v4
103+
with:
104+
java-version: 8
105+
distribution: temurin
106+
-
107+
name: Import GPG key
108+
uses: crazy-max/ghaction-import-gpg@v6
109+
with:
110+
gpg_private_key: ${{ env.MAVEN_GPG_PRIVATE_KEY }}
111+
passphrase: MAVEN_GPG_PASSPHRASE
112+
-
113+
name: Install deps
114+
run: make deps
115+
-
116+
name: Install package
117+
run: make install
118+
-
119+
name: Setup Homebrew
120+
uses: Homebrew/actions/setup-homebrew@master
121+
-
122+
name: Install topaz
123+
run: brew tap aserto-dev/tap && brew install aserto-dev/tap/topaz && topaz install && topaz templates install todo --no-console --force
124+
-
125+
name: Build examples
126+
working-directory: examples
127+
run: mvn --no-transfer-progress clean package
128+
-
129+
name: Run examples
130+
working-directory: examples
131+
run: |
132+
cp assets/.env.topaz-directory.example .env
133+
java -jar target/examples-1.0.0-SNAPSHOT-shaded.jar
134+
135+
release:
136+
runs-on: ubuntu-latest
137+
needs: test
54138
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
55139
name: Release to maven central
56140
steps:
57-
- name: Read Configuration
141+
-
142+
name: Read configuration
58143
uses: hashicorp/vault-action@v3
59144
id: vault
60145
with:
61146
url: ${{ env.VAULT_ADDR }}
62147
token: ${{ secrets.VAULT_TOKEN }}
63148
secrets: |
149+
kv/data/github "USERNAME" | GH_USERNAME;
150+
kv/data/github "READ_WRITE_TOKEN" | GH_TOKEN;
151+
kv/data/buf.build "ASERTO_BUF_USER" | BUF_USER;
152+
kv/data/buf.build "ASERTO_BUF_TOKEN" | BUF_TOKEN;
64153
kv/data/MavenCentral "USERNAME" | MAVEN_USERNAME;
65154
kv/data/MavenCentral "PASSWORD" | MAVEN_CENTRAL_TOKEN;
66155
kv/data/MavenCentral "GPG_PASSPHRASE" | MAVEN_GPG_PASSPHRASE;
67156
kv/data/MavenCentral "PRIVATE_GPG_KEY" | MAVEN_GPG_PRIVATE_KEY;
68157
kv/data/MavenCentral "TOKEN_USERNAME" | TOKEN_USERNAME;
69158
kv/data/MavenCentral "TOKEN_PASSWORD" | TOKEN_PASSWORD;
70-
71-
- name: Checkout
159+
-
160+
name: Checkout
72161
uses: actions/checkout@v4
73162
with:
74163
fetch-depth: 0
75-
76-
- name: Set up Java for publishing to Maven Central Repository
164+
-
165+
name: Set up Java for publishing to Maven Central Repository
77166
uses: actions/setup-java@v4
78167
with:
79168
java-version: 8
@@ -83,24 +172,24 @@ jobs:
83172
server-password: TOKEN_PASSWORD
84173
gpg-private-key: ${{ env.MAVEN_GPG_PRIVATE_KEY }}
85174
gpg-passphrase: MAVEN_GPG_PASSPHRASE
86-
87-
- name: build artifact
88-
run: mvn --no-transfer-progress clean package
89-
90-
- name: Create release
175+
-
176+
name: Build
177+
run: make build
178+
-
179+
name: Create release
91180
uses: ncipollo/release-action@v1
92181
with:
93182
allowUpdates: true
94183
artifacts: "${{ github.workspace }}/target/*.jar"
95184
token: ${{ secrets.GITHUB_TOKEN }}
96-
97-
- name: Publish to the Maven Central Repository
98-
run: mvn --no-transfer-progress --batch-mode deploy
99-
100-
- name: Bump to the next version
101-
run: go run mage.go bump patch
102-
103-
- name: Commit changes
185+
-
186+
name: Publish to the Maven Central Repository
187+
run: make deploy
188+
-
189+
name: Bump to the next version
190+
run: make bump
191+
-
192+
name: Commit changes
104193
uses: EndBug/add-and-commit@v9
105194
with:
106195
default_author: github_actions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: gitleaks-check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 0
12+
- name: gitleaks-check
13+
uses: aserto-dev/gitleaks-action@master

Depfile

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,37 @@
22

33
[![slack](https://img.shields.io/badge/slack-Aserto%20Community-brightgreen)](https://asertocommunity.slack.com)
44

5-
Java GRPC bindings for aserto directory. Those are raw bindings, for a better developer experience we recommend you use [aserto-java](https://github.com/aserto-dev/aserto-java) or [aserto-spring](https://github.com/aserto-dev/aserto-spring) if your project already uses Spring.
5+
Generated Java gRPC bindings for the Topaz and Aserto Directory Service; these are low-level bindings.
6+
For a more idiomatic Java development experience, we advise using the [aserto-java](https://github.com/aserto-dev/aserto-java) or [aserto-spring](https://github.com/aserto-dev/aserto-spring) when your project is using Spring.
67

78

89
## Requirements
9-
- [buf cli](https://docs.buf.build/installation)
10+
- GNU make
1011
- [maven](https://maven.apache.org/guides/introduction/introduction-to-the-pom.html)
11-
- java 1.8 or newer
12+
- Java 8 or newer
13+
14+
If you need to regenerate the protobuf binding you will also need the:
15+
- [buf cli](https://docs.buf.build/installation), which will be installed by using `make deps`
1216

1317
### Building the project
1418
```bash
15-
mvn clean && mvn package
19+
make build
20+
```
21+
22+
or
23+
24+
```bash
25+
mvn clean package
1626
```
27+
1728
If you want to install the package to your local maven repository in order to include it in other projects
29+
30+
```bash
31+
make install
32+
```
33+
34+
or
35+
1836
```bash
19-
mvn clean && mvn install
37+
mvn clean install
2038
```

buf.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: v1
2+
3+
deps:
4+
- buf.build/aserto-dev/aserto
5+
6+
lint:
7+
use:
8+
- DEFAULT
9+
except:
10+
- PACKAGE_DIRECTORY_MATCH
11+
- SERVICE_SUFFIX
12+
- PACKAGE_VERSION_SUFFIX
13+
enum_zero_value_suffix: _UNKNOWN
14+
15+
breaking:
16+
use:
17+
- FILE
18+
- PACKAGE
19+
- WIRE
20+
- WIRE_JSON

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cd examples
1515
To build the example package, execute:
1616

1717
```
18-
mvn clean && mvn package
18+
mvn clean package
1919
```
2020

2121
## 2. setup environment

go.mod

Lines changed: 0 additions & 5 deletions
This file was deleted.

go.sum

Lines changed: 0 additions & 2 deletions
This file was deleted.

mage.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

magefiles/go.mod

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)