10
10
jobs :
11
11
# On PR: Run Cargo tests, build, and update
12
12
pr_checks :
13
- # if: github.event_name == 'pull_request'
13
+ if : github.event_name == 'pull_request'
14
14
runs-on : ubuntu-latest
15
15
steps :
16
16
- name : Checkout repository
@@ -31,14 +31,10 @@ jobs:
31
31
32
32
- name : Run cargo update
33
33
run : cargo update
34
- # cargo generate-lockfile
35
- # cargo update --offline
36
34
37
- # cargo update --locked
38
-
39
- # On Release: Publish Cargo package, build and push Docker images
35
+ # On Release: Publish Cargo package, build and push Docker image
40
36
release :
41
- # if: github.event_name == 'release'
37
+ if : github.event_name == 'release'
42
38
runs-on : ubuntu-latest
43
39
steps :
44
40
- name : Checkout repository
@@ -65,26 +61,27 @@ jobs:
65
61
66
62
- name : Update Cargo.toml version
67
63
run : |
68
- #sed -i '/\[package\]/,/^version = /s/^version = .*/version = \"${{ github.event.release.tag_name }}\"/' Cargo.toml
69
- sed -i '/\[package\]/,/^version = /s/^version = .*/version = \"1.1.1\"/' Cargo.toml
64
+ sed -i '/\[package\]/,/^version = /s/^version = .*/version = \"${{ github.event.release.tag_name }}\"/' Cargo.toml
70
65
cat Cargo.toml
71
66
72
67
- name : Dry run cargo publish
73
68
run : cargo publish --dry-run --allow-dirty
74
69
75
- # - name: Publish package to crates.io
76
- # run: cargo publish
77
- # env:
78
- # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
79
-
80
70
- name : Build & Push cedar-agent
81
71
uses : docker/build-push-action@v4
82
72
with :
83
73
file : Dockerfile
84
74
platforms : linux/amd64,linux/arm64
85
- push : false
75
+ push : true
86
76
cache-from : type=registry,ref=permitio/cedar-agent:latest
87
77
cache-to : type=inline
88
78
tags : |
89
79
permitio/cedar-agent:latest
90
- permitio/cedar-agent:1.1.1
80
+ permitio/cedar-agent:${{ github.event.release.tag_name }}
81
+
82
+ - name : Publish package to crates.io
83
+ run : cargo publish --token ${CRATES_TOKEN}
84
+ env :
85
+ CRATES_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
86
+
87
+
0 commit comments