Skip to content

Commit 18d7c7b

Browse files
authored
Release actions to support homebrew and deb packages (#245)
* Action to bundle rust library source * PR trigger * Correct pwsh syntax * Update path * Remove Linter * Upload fix * Final * Add deb package creation * Use cargo deb instead * Correct * Update cargo.toml * Add matrix * Override * Fix * Install target * Update * Buid * Custom container * Add pwsh * Update
1 parent 9f98973 commit 18d7c7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+127
-5401
lines changed

.github/workflows/linter.yml

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

.github/workflows/release-rust.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: "Rust (release)"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
packageVersion:
7+
description: 'Version to build'
8+
required: true
9+
default: 'v1.0.0'
10+
workflow_run:
11+
workflows: ["Release Platform Libraries"]
12+
branches: ["main", "v?.*"]
13+
types:
14+
- completed
15+
16+
jobs:
17+
package_source:
18+
name: Package Source
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v1
23+
24+
- name: Generate Package Version
25+
run: |
26+
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' `
27+
-Headers @{ "Authorization" = "Token $env:API_GITHUB_TOKEN"} | ConvertFrom-Json
28+
$version = $json.tag_name.Trim("v")
29+
echo "RELEASE_VERSION=$($json.tag_name)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
30+
echo "PACKAGE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
31+
shell: pwsh
32+
env:
33+
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
34+
35+
- name: Create Archive
36+
run: |
37+
cp -r include native
38+
rm native/build.rs
39+
mv native okapi
40+
sed -i 's/version = "0.1.0"/version = "${{ env.PACKAGE_VERSION }}"/g' native/Cargo.toml
41+
tar -czvf okapi-${{ env.PACKAGE_VERSION }}.tar.gz okapi
42+
43+
- name: Upload Artifact
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: archive
47+
path: |
48+
./*.tar.gz
49+
50+
- name: Upload to Release
51+
uses: svenstaro/upload-release-action@v2
52+
with:
53+
repo_token: ${{ secrets.GITHUB_TOKEN }}
54+
file: ./okapi-${{ env.PACKAGE_VERSION }}.tar.gz
55+
asset_name: okapi-${{ env.PACKAGE_VERSION }}.tar.gz
56+
tag: ${{ env.RELEASE_VERSION }}
57+
overwrite: false
58+
body: "Okapi Library Source"
59+
60+
make_deb:
61+
name: Make Debian Package
62+
runs-on: ubuntu-latest
63+
# strategy:
64+
# matrix:
65+
# arch: [amd64]
66+
# include:
67+
# - arch: x86_64
68+
# target: x86_64-unknown-linux-gnu
69+
# image: macos-latest
70+
# - arch: amd64
71+
# target: aarch64-unknown-linux-gnu
72+
# image: ubuntu-latest
73+
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v1
77+
78+
- name: Generate Package Version
79+
run: |
80+
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' `
81+
-Headers @{ "Authorization" = "Token $env:API_GITHUB_TOKEN"} | ConvertFrom-Json
82+
$version = $json.tag_name.Trim("v")
83+
echo "RELEASE_VERSION=$($json.tag_name)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
84+
echo "PACKAGE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
85+
shell: pwsh
86+
env:
87+
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
88+
89+
- name: Create Package (.deb)
90+
run: |
91+
cargo install cargo-deb
92+
sed -i 's/version = "0.1.0"/version = "${{ env.PACKAGE_VERSION }}"/g' Cargo.toml
93+
cargo deb
94+
working-directory: native
95+
96+
- name: Upload Artifact
97+
uses: actions/upload-artifact@v2
98+
with:
99+
name: deb
100+
path: |
101+
./native/target/**/*.deb
102+
103+
- name: Upload to Release
104+
uses: svenstaro/upload-release-action@v2
105+
with:
106+
repo_token: ${{ secrets.GITHUB_TOKEN }}
107+
file: ./native/target/debian/okapi_${{ env.PACKAGE_VERSION }}_amd64.deb
108+
asset_name: okapi_${{ env.PACKAGE_VERSION }}_amd64.deb
109+
tag: ${{ env.RELEASE_VERSION }}
110+
overwrite: false
111+
body: "Okapi Debian Package"

Okapi-iOS.podspec

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

native/Cargo.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,19 @@ cbindgen = "0.19.0"
3434

3535
[dev-dependencies]
3636
fluid = "0.4"
37-
wasm-bindgen-test = "0.3.13"
37+
wasm-bindgen-test = "0.3.13"
38+
39+
[package.metadata.deb]
40+
maintainer = "Tomislav Markovski <[email protected]>"
41+
copyright = "2021, Trinsic <[email protected]>"
42+
license-file = ["../LICENSE", "4"]
43+
extended-description = """\
44+
Collection of tools that support workflows for \
45+
authentic data and identity management."""
46+
depends = "$auto"
47+
section = "utility"
48+
priority = "optional"
49+
assets = [
50+
["target/release/libokapi.so", "usr/local/lib/", "644"],
51+
["../include/okapi.h", "usr/local/include/", "644"],
52+
]

objc/.gitignore

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

0 commit comments

Comments
 (0)