15
15
runs-on : ubuntu-latest
16
16
timeout-minutes : 10
17
17
steps :
18
+ - name : Load secrets
19
+ id : op-load-secret
20
+ uses : 1password/load-secrets-action@v2
21
+ with :
22
+ export-env : false
23
+ env :
24
+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
25
+ CARGO_REGISTRY_TOKEN : " op://GitHubActionsPublic/CARGO_REGISTRY_TOKEN/credential"
26
+
18
27
- uses : actions/checkout@v3
19
28
- run : cargo build --verbose
20
29
- run : cargo test update_package_version -- ${{ inputs.tag }} --nocapture
24
33
git commit -m "Update cargo.toml version to ${{ env.GIT_TAG }}" -a
25
34
- run : cargo publish --manifest-path csbindgen/Cargo.toml
26
35
env :
27
- CARGO_REGISTRY_TOKEN : ${{ secrets .CARGO_REGISTRY_TOKEN }}
36
+ CARGO_REGISTRY_TOKEN : ${{ steps.op-load-secret.outputs .CARGO_REGISTRY_TOKEN }}
28
37
- run : git tag ${{ env.GIT_TAG }}
29
38
- name : Push changes
30
39
uses : ad-m/github-push-action@master
@@ -38,12 +47,21 @@ jobs:
38
47
runs-on : ubuntu-latest
39
48
timeout-minutes : 10
40
49
steps :
50
+ - name : Load secrets
51
+ id : op-load-secret
52
+ uses : 1password/load-secrets-action@v2
53
+ with :
54
+ export-env : false
55
+ env :
56
+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
57
+ NUGET_KEY : " op://GitHubActionsPublic/NUGET_KEY/credential"
58
+
41
59
- uses : actions/checkout@v3
42
60
- uses : Cysharp/Actions/.github/actions/setup-dotnet@main
43
61
# pack nuget
44
62
- run : dotnet build -c Release -p:Version=${{ inputs.tag }}
45
63
- run : dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish
46
- - run : dotnet nuget push "./publish/*.nupkg" -s https://www.nuget.org/api/v2/package -k ${{ secrets .NUGET_KEY }}
64
+ - run : dotnet nuget push "./publish/*.nupkg" -s https://www.nuget.org/api/v2/package -k ${{ steps.op-load-secret.outputs .NUGET_KEY }}
47
65
48
66
create-release :
49
67
needs : [build-dotnet, build-and-push-rust]
0 commit comments