|
|
@ -10,7 +10,7 @@ on: |
|
|
required: false |
|
|
required: false |
|
|
default: "" |
|
|
default: "" |
|
|
tag_name: |
|
|
tag_name: |
|
|
description: "Tag to use for artifacts/images (defaults to adhoc-<sha>)" |
|
|
description: "Tag to use for artifacts/images (defaults to <sha>)" |
|
|
required: false |
|
|
required: false |
|
|
default: "" |
|
|
default: "" |
|
|
attach_to_release: |
|
|
attach_to_release: |
|
|
@ -36,53 +36,56 @@ jobs: |
|
|
# For manual runs, allow building a chosen ref (branch/tag/SHA) |
|
|
# For manual runs, allow building a chosen ref (branch/tag/SHA) |
|
|
ref: ${{ inputs.ref != '' && inputs.ref || github.ref }} |
|
|
ref: ${{ inputs.ref != '' && inputs.ref || github.ref }} |
|
|
|
|
|
|
|
|
- name: Determine tag for this run |
|
|
- name: Determine tag & latest flag |
|
|
id: meta |
|
|
id: meta |
|
|
|
|
|
shell: bash |
|
|
run: | |
|
|
run: | |
|
|
# tag from release event, or user input, or fallback to adhoc-<shortsha> |
|
|
# Determine TAG |
|
|
if [ "${{ github.event_name }}" = "release" ]; then |
|
|
if [ "${{ github.event_name }}" = "release" ]; then |
|
|
TAG="${{ github.event.release.tag_name }}" |
|
|
TAG="${{ github.event.release.tag_name }}" |
|
|
|
|
|
# Push "latest" only for full releases (not prereleases) |
|
|
|
|
|
if [ "${{ github.event.release.prerelease }}" = "true" ]; then |
|
|
|
|
|
PUSH_LATEST="false" |
|
|
|
|
|
else |
|
|
|
|
|
PUSH_LATEST="true" |
|
|
|
|
|
fi |
|
|
elif [ -n "${{ inputs.tag_name }}" ]; then |
|
|
elif [ -n "${{ inputs.tag_name }}" ]; then |
|
|
TAG="${{ inputs.tag_name }}" |
|
|
TAG="${{ inputs.tag_name }}" |
|
|
|
|
|
PUSH_LATEST="false" |
|
|
else |
|
|
else |
|
|
SHA="$(git rev-parse --short=12 HEAD)" |
|
|
SHA="$(git rev-parse --short=12 HEAD)" |
|
|
TAG="adhoc-${SHA}" |
|
|
TAG="adhoc-${SHA}" |
|
|
|
|
|
PUSH_LATEST="false" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
echo "tag=$TAG" >> "$GITHUB_OUTPUT" |
|
|
echo "tag=$TAG" >> "$GITHUB_OUTPUT" |
|
|
echo "Resolved tag: $TAG" |
|
|
echo "push_latest=$PUSH_LATEST" >> "$GITHUB_OUTPUT" |
|
|
|
|
|
echo "Resolved tag: $TAG (push_latest=$PUSH_LATEST)" |
|
|
|
|
|
|
|
|
# --- Setup Node.js and pnpm --- |
|
|
# --- Setup Node.js and pnpm (with cache) --- |
|
|
- name: Setup Node.js |
|
|
- name: Setup Node.js |
|
|
uses: actions/setup-node@v4 |
|
|
uses: actions/setup-node@v4 |
|
|
with: |
|
|
with: |
|
|
node-version: 22 |
|
|
node-version: 22 |
|
|
|
|
|
cache: pnpm |
|
|
|
|
|
cache-dependency-path: '**/pnpm-lock.yaml' |
|
|
|
|
|
|
|
|
- name: Setup pnpm |
|
|
- name: Setup pnpm |
|
|
uses: pnpm/action-setup@v4 |
|
|
uses: pnpm/action-setup@v4 |
|
|
with: |
|
|
with: |
|
|
version: latest |
|
|
version: latest |
|
|
|
|
|
|
|
|
# --- Cache pnpm Dependencies --- |
|
|
|
|
|
- name: Cache pnpm Dependencies |
|
|
|
|
|
uses: actions/cache@v4 |
|
|
|
|
|
with: |
|
|
|
|
|
path: | |
|
|
|
|
|
~/.pnpm-store |
|
|
|
|
|
packages/web/node_modules |
|
|
|
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} |
|
|
|
|
|
restore-keys: | |
|
|
|
|
|
${{ runner.os }}-pnpm- |
|
|
|
|
|
|
|
|
|
|
|
- name: Install dependencies |
|
|
- name: Install dependencies |
|
|
run: pnpm install --frozen-lockfile |
|
|
run: pnpm install --frozen-lockfile |
|
|
|
|
|
|
|
|
- name: Create Web App Release Archive |
|
|
- name: Create Web App Release Archive |
|
|
run: pnpm --filter "meshtastic-web" run package |
|
|
working-directory: packages/web |
|
|
|
|
|
run: pnpm run package |
|
|
|
|
|
|
|
|
- name: Upload Web App Archive (artifact) |
|
|
- name: Upload Web App Archive (artifact) |
|
|
uses: actions/upload-artifact@v4 |
|
|
uses: actions/upload-artifact@v4 |
|
|
with: |
|
|
with: |
|
|
name: web-build |
|
|
name: web-build-${{ steps.meta.outputs.tag }} |
|
|
if-no-files-found: error |
|
|
if-no-files-found: error |
|
|
path: packages/web/dist/build.tar |
|
|
path: packages/web/dist/build.tar |
|
|
|
|
|
|
|
|
@ -90,6 +93,7 @@ jobs: |
|
|
if: ${{ github.event_name == 'release' || inputs.attach_to_release == true }} |
|
|
if: ${{ github.event_name == 'release' || inputs.attach_to_release == true }} |
|
|
env: |
|
|
env: |
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
|
|
shell: bash |
|
|
run: | |
|
|
run: | |
|
|
if [ "${{ github.event_name }}" = "release" ]; then |
|
|
if [ "${{ github.event_name }}" = "release" ]; then |
|
|
TAG="${{ steps.meta.outputs.tag }}" |
|
|
TAG="${{ steps.meta.outputs.tag }}" |
|
|
@ -105,6 +109,22 @@ jobs: |
|
|
- name: Set up QEMU |
|
|
- name: Set up QEMU |
|
|
uses: docker/setup-qemu-action@v3 |
|
|
uses: docker/setup-qemu-action@v3 |
|
|
|
|
|
|
|
|
|
|
|
- name: Compute image tags |
|
|
|
|
|
id: tags |
|
|
|
|
|
shell: bash |
|
|
|
|
|
run: | |
|
|
|
|
|
if [ "${{ steps.meta.outputs.push_latest }}" = "true" ]; then |
|
|
|
|
|
echo "list=latest, ${{ steps.meta.outputs.tag }}" >> "$GITHUB_OUTPUT" |
|
|
|
|
|
else |
|
|
|
|
|
echo "list=${{ steps.meta.outputs.tag }}" >> "$GITHUB_OUTPUT" |
|
|
|
|
|
fi |
|
|
|
|
|
TAGS="latest, ${{ steps.meta.outputs.tag }}" |
|
|
|
|
|
else |
|
|
|
|
|
TAGS="${{ steps.meta.outputs.tag }}" |
|
|
|
|
|
fi |
|
|
|
|
|
echo "list=$TAGS" >> "$GITHUB_OUTPUT" |
|
|
|
|
|
echo "Using image tags: $TAGS" |
|
|
|
|
|
|
|
|
- name: Build Container Image |
|
|
- name: Build Container Image |
|
|
id: build-container |
|
|
id: build-container |
|
|
uses: redhat-actions/buildah-build@v2 |
|
|
uses: redhat-actions/buildah-build@v2 |
|
|
@ -112,7 +132,7 @@ jobs: |
|
|
containerfiles: | |
|
|
containerfiles: | |
|
|
./packages/web/infra/Containerfile |
|
|
./packages/web/infra/Containerfile |
|
|
image: ${{ env.REGISTRY_IMAGE }} |
|
|
image: ${{ env.REGISTRY_IMAGE }} |
|
|
tags: latest, ${{ steps.meta.outputs.tag }} |
|
|
tags: ${{ steps.tags.outputs.list }} |
|
|
oci: true |
|
|
oci: true |
|
|
platforms: linux/amd64, linux/arm64 |
|
|
platforms: linux/amd64, linux/arm64 |
|
|
|
|
|
|
|
|
|