Skip to content

Commit 62a9cf8

Browse files
committed
final - after check
1 parent 8d156f2 commit 62a9cf8

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

.github/workflows/build_release.yml

+13-16
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
# On PR: Run Cargo tests, build, and update
1212
pr_checks:
13-
#if: github.event_name == 'pull_request'
13+
if: github.event_name == 'pull_request'
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout repository
@@ -31,14 +31,10 @@ jobs:
3131

3232
- name: Run cargo update
3333
run: cargo update
34-
#cargo generate-lockfile
35-
#cargo update --offline
3634

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
4036
release:
41-
#if: github.event_name == 'release'
37+
if: github.event_name == 'release'
4238
runs-on: ubuntu-latest
4339
steps:
4440
- name: Checkout repository
@@ -65,26 +61,27 @@ jobs:
6561

6662
- name: Update Cargo.toml version
6763
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
7065
cat Cargo.toml
7166
7267
- name: Dry run cargo publish
7368
run: cargo publish --dry-run --allow-dirty
7469

75-
# - name: Publish package to crates.io
76-
# run: cargo publish
77-
# env:
78-
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
79-
8070
- name: Build & Push cedar-agent
8171
uses: docker/build-push-action@v4
8272
with:
8373
file: Dockerfile
8474
platforms: linux/amd64,linux/arm64
85-
push: false
75+
push: true
8676
cache-from: type=registry,ref=permitio/cedar-agent:latest
8777
cache-to: type=inline
8878
tags: |
8979
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

Comments
 (0)