Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/nightly-build-1x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ on:
required: true
type: string

outputs:
version:
value: ${{ jobs.build-linux.outputs.version }}

env:
S3_BUCKET: ${{ inputs.s3_bucket }}
S3_PREFIX: ${{ inputs.s3_prefix }}
AWS_DEFAULT_REGION: ${{ inputs.aws_region }}

jobs:
build-linux:
outputs:
version: ${{ steps.version.outputs.version }}
env:
CARGO_TERM_COLOR: always
# sccache
Expand Down Expand Up @@ -83,10 +89,12 @@ jobs:
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libxdo-dev unzip protobuf-compiler libprotobuf-dev rpm awscli jq

- name: Write build version
id: version
run: |
VERSION=$(jq -r .version src-tauri/tauri.conf.json)
echo Version: $VERSION
echo "VERSION=$VERSION" >> ${GITHUB_ENV}
echo "version=$VERSION" >> ${GITHUB_OUTPUT}
BRANCH="${{ inputs.branch }}"
echo "BRANCH=${BRANCH//\//-}" >> ${GITHUB_ENV}
echo "SHA=$(git rev-parse --short HEAD)" >> ${GITHUB_ENV}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/nightly-build-2x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
required: true
type: string

outputs:
version:
value: ${{ jobs.build-linux.outputs.version }}

env:
SQLX_OFFLINE: "1"
S3_BUCKET: ${{ inputs.s3_bucket }}
Expand All @@ -24,6 +28,8 @@ env:

jobs:
build-linux:
outputs:
version: ${{ steps.version.outputs.version }}
runs-on:
- self-hosted
- Linux
Expand Down Expand Up @@ -86,10 +92,12 @@ jobs:
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libxdo-dev unzip protobuf-compiler libprotobuf-dev rpm awscli jq

- name: Write build version
id: version
run: |
VERSION=$(jq -r .version src-tauri/tauri.conf.json)
echo Version: $VERSION
echo "VERSION=$VERSION" >> ${GITHUB_ENV}
echo "version=$VERSION" >> ${GITHUB_OUTPUT}
echo "DEFGUARD_CLIENT_BUILD_VERSION=${VERSION}-nightly" >> ${GITHUB_ENV}
BRANCH="${{ inputs.branch }}"
echo "BRANCH=${BRANCH//\//-}" >> ${GITHUB_ENV}
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@ jobs:
aws_region: eu-central-1
secrets: inherit

main:
dev:
needs: release-2-1
if: always()
uses: ./.github/workflows/nightly-build-2x.yaml
with:
branch: dev
s3_bucket: nightly.defguard.net
s3_prefix: defguard-client
aws_region: eu-central-1
secrets: inherit

main:
needs: dev
if: always()
uses: ./.github/workflows/nightly-build-1x.yaml
with:
branch: main
Expand All @@ -33,6 +44,7 @@ jobs:
update-index:
needs:
- release-2-1
- dev
- main
if: always()
runs-on:
Expand All @@ -49,7 +61,16 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_NIGHTLY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY_NIGHTLY }}
VERSION_RELEASE_2_1: ${{ needs.release-2-1.outputs.version }}
VERSION_DEV: ${{ needs.dev.outputs.version }}
VERSION_MAIN: ${{ needs.main.outputs.version }}
run: |
jq -n \
--arg release_2_1 "${VERSION_RELEASE_2_1:-unknown}" \
--arg dev "${VERSION_DEV:-unknown}" \
--arg main "${VERSION_MAIN:-unknown}" \
'{"release-2.1": $release_2_1, "dev": $dev, "main": $main}' > versions.json

aws s3api list-objects-v2 \
--bucket "${S3_BUCKET}" \
--prefix "${S3_PREFIX}/" \
Expand All @@ -62,13 +83,15 @@ jobs:
echo '<title>defguard-client nightly builds</title>'
echo '<style>body{font-family:sans-serif;margin:2rem}table{border-collapse:collapse;margin-bottom:2rem}th,td{padding:.3rem 1.5rem .3rem 0;border-bottom:1px solid #ddd;white-space:nowrap}</style>'
echo '<h1>defguard-client nightly builds</h1>'
jq -r '
jq -r --slurpfile versions versions.json '
(. // [])
| group_by(.key | split("/")[1])
| map(sort_by(.modified) | reverse)
| sort_by(.[0].modified) | reverse
| .[]
| "<h2>\(.[0].key | split("/")[1])</h2>",
| (.[0].key | split("/")[1]) as $directory
| ($versions[0][$directory] // "unknown") as $version
| "<h2>\($directory) (\($version))</h2>",
"<table><tr><th align=\"left\">File</th><th align=\"right\">Size</th><th align=\"left\">Uploaded on (UTC)</th></tr>",
(.[] | "<tr><td><a href=\"/\(.key)\">\(.key | split("/")[2])</a></td><td align=\"right\">\((.size / 104857.6 | round) / 10) MiB</td><td>\(.modified[0:10]) \(.modified[11:16])</td></tr>"),
"</table>"
Expand Down
Loading