Skip to content

Commit 4909c6c

Browse files
committed
workflows
1 parent 51bc137 commit 4909c6c

File tree

2 files changed

+10
-99
lines changed

2 files changed

+10
-99
lines changed

.github/workflows/buildService.yml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,7 @@ on:
1010
branches: ['main', 'master', 'update/040']
1111

1212
jobs:
13-
BuildPackage:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Prepare StartOS SDK
17-
uses: start9labs/sdk@v2
18-
19-
- name: Checkout services repository
20-
uses: actions/checkout@v5
21-
with:
22-
submodules: recursive
23-
24-
- name: Build the service package
25-
id: build
26-
run: |
27-
start-cli init-key
28-
RUST_LOG=debug RUST_BACKTRACE=1 make
29-
PACKAGE_ID=$(start-cli s9pk inspect *.s9pk manifest | jq -r '.id')
30-
echo "package_id=${PACKAGE_ID}" >> $GITHUB_ENV
31-
printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n"
32-
shell: bash
33-
34-
- name: Upload .s9pk
35-
uses: actions/upload-artifact@v5
36-
with:
37-
name: ${{ env.package_id }}.s9pk
38-
path: ./${{ env.package_id }}.s9pk
13+
build:
14+
uses: start9labs/shared-workflows/.github/workflows/buildService.yml@master
15+
secrets:
16+
DEV_KEY: ${{ secrets.DEV_KEY }}

.github/workflows/releaseService.yml

Lines changed: 6 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -6,78 +6,11 @@ on:
66
- 'v*.*'
77

88
jobs:
9-
ReleasePackage:
10-
runs-on: ubuntu-latest
9+
release:
10+
uses: start9labs/shared-workflows/.github/workflows/releaseService.yml@master
11+
with:
12+
REGISTRY: ${{ vars.REGISTRY }} # Optional. Defaults to https://alpha-registry-x.start9.com
13+
secrets:
14+
DEV_KEY: ${{ secrets.DEV_KEY }} # Required
1115
permissions:
1216
contents: write
13-
steps:
14-
- name: Prepare StartOS SDK
15-
uses: start9labs/sdk@v2
16-
17-
- name: Checkout services repository
18-
uses: actions/checkout@v5
19-
with:
20-
submodules: recursive
21-
22-
- name: Build the service package
23-
id: build
24-
env:
25-
S9DEVKEY: ${{ secrets.S9DEVKEY }}
26-
run: |
27-
start-cli init-key
28-
if [[ -n "$S9DEVKEY" ]]; then
29-
echo "Using developer key from secrets to sign the package."
30-
printf '%s' "$S9DEVKEY" > ~/.startos/developer.key.pem
31-
else
32-
echo "Using newly generated developer key to sign the package."
33-
fi
34-
RUST_LOG=debug RUST_BACKTRACE=1 make
35-
sleep 2
36-
MANIFEST_JSON=$(start-cli s9pk inspect *.s9pk manifest)
37-
PACKAGE_ID=$(echo "$MANIFEST_JSON" | jq -r '.id')
38-
PACKAGE_TITLE=$(echo "$MANIFEST_JSON" | jq -r '.title')
39-
echo "package_id=${PACKAGE_ID}" >> $GITHUB_ENV
40-
echo "package_title=${PACKAGE_TITLE}" >> $GITHUB_ENV
41-
printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n"
42-
shell: bash
43-
44-
- name: Generate sha256 checksum
45-
run: |
46-
sha256sum ${{ env.package_id }}.s9pk > ${{ env.package_id }}.s9pk.sha256
47-
shell: bash
48-
49-
- name: Generate changelog
50-
run: |
51-
echo "## What's Changed" > change-log.txt
52-
echo "" >> change-log.txt
53-
RELEASE_NOTES=$(start-cli s9pk inspect *.s9pk manifest | jq -r '.releaseNotes')
54-
echo "${RELEASE_NOTES}" >> change-log.txt
55-
echo "## SHA256 Hash" >> change-log.txt
56-
echo '```' >> change-log.txt
57-
sha256sum ${{ env.package_id }}.s9pk >> change-log.txt
58-
echo '```' >> change-log.txt
59-
shell: bash
60-
61-
- name: Create GitHub Release
62-
uses: softprops/action-gh-release@v2
63-
with:
64-
tag_name: ${{ github.ref_name }}
65-
name: ${{ env.package_title }} ${{ github.ref_name }}
66-
prerelease: true
67-
body_path: change-log.txt
68-
files: |
69-
./${{ env.package_id }}.s9pk
70-
./${{ env.package_id }}.s9pk.sha256
71-
72-
- name: Publish to Registry
73-
env:
74-
S9DEVKEY: ${{ secrets.S9DEVKEY }}
75-
S9REGISTRY: ${{ secrets.S9REGISTRY }}
76-
run: |
77-
if [[ -z "$S9DEVKEY" || -z "$S9REGISTRY" ]]; then
78-
echo "Publish skipped: One or both of S9DEVKEY and S9REGISTRY secrets are not set."
79-
else
80-
echo "Publishing package to registry..."
81-
start-cli --registry https://$S9REGISTRY registry package add ${{ env.package_id }}.s9pk ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/${{ env.package_id }}.s9pk
82-
fi
83-
shell: bash

0 commit comments

Comments
 (0)