mirror of
https://github.com/outbackdingo/openwrt-builder.git
synced 2026-01-27 10:19:59 +00:00
Improve github actions print commit sha-1
This commit is contained in:
8
.github/workflows/ax3200.yaml
vendored
8
.github/workflows/ax3200.yaml
vendored
@@ -1,5 +1,5 @@
|
||||
---
|
||||
# Based on https://github.com/glassd00r/Openwrt_Builder/tree/main
|
||||
# Based on https://github.com/JuliusBairaktaris/Qualcommax_NSS_Builder/blob/main/.github/workflows/build.yaml
|
||||
name: Build OpenWRT for Xiaomi AX3200
|
||||
|
||||
on:
|
||||
@@ -27,7 +27,9 @@ jobs:
|
||||
|
||||
- name: Get the latest commit SHA
|
||||
id: get_sha
|
||||
run: echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
run: |
|
||||
echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: Build OpenWRT for AX3200
|
||||
@@ -81,7 +83,7 @@ jobs:
|
||||
|
||||
release:
|
||||
name: Create release
|
||||
needs: [build]
|
||||
needs: [build, check_commits]
|
||||
if: needs.build.result == 'success'
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
|
||||
35
.github/workflows/ax3600.yaml
vendored
35
.github/workflows/ax3600.yaml
vendored
@@ -1,5 +1,5 @@
|
||||
---
|
||||
# Based on https://github.com/glassd00r/Openwrt_Builder/tree/main
|
||||
# Based on https://github.com/JuliusBairaktaris/Qualcommax_NSS_Builder/blob/main/.github/workflows/build.yaml
|
||||
# It includes the NSS package: https://github.com/qosmio/nss-packages
|
||||
name: Build OpenWRT for Xiaomi AX3600 NSS build
|
||||
|
||||
@@ -14,23 +14,31 @@ env:
|
||||
DEVICE_CONFIG: configs/qualcommax/ax3600
|
||||
ROLE_CONFIG: configs/common/main-router
|
||||
NSS_CONFIG: configs/common/nss
|
||||
NSS_PACKAGES_REPOSITORY: qosmio/nss-packages
|
||||
NSS_PACKAGES_REPOSITORY_BRANCH: NSS-12.5-K6.x
|
||||
|
||||
jobs:
|
||||
check_commits:
|
||||
name: Check Commits
|
||||
name: Check for new commits
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
latest_commit_sha: ${{ steps.get_sha.outputs.latest_commit_sha }}
|
||||
new_commits: ${{ steps.check_new_commits.outputs.new_commits }}
|
||||
latest_commit_sha: ${{ steps.check_new_commits.outputs.latest_commit_sha }}
|
||||
steps:
|
||||
- name: Checkout remote repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ env.REMOTE_REPOSITORY }}
|
||||
ref: ${{ env.REMOTE_BRANCH }}
|
||||
|
||||
- name: Get the latest commit SHA
|
||||
id: get_sha
|
||||
run: echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
- name: Check for new commits
|
||||
id: check_new_commits
|
||||
run: |
|
||||
latest_commit_sha=$(curl -sL "https://api.github.com/repos/${{ env.REMOTE_REPOSITORY }}/commits?sha=${{ env.REMOTE_BRANCH }}&per_page=1" | jq -r '.[0].sha')
|
||||
last_built_commit_sha=$(curl -sL "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.body' | grep -oP 'Build Commit: \K\w+' || echo '')
|
||||
echo "new_commits=$([[ "$latest_commit_sha" != "$last_built_commit_sha" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT
|
||||
echo "latest_commit_sha=$latest_commit_sha" >> $GITHUB_OUTPUT
|
||||
- name: Check for new commits in NSS Packages Repository
|
||||
id: check_nss_packages_repo_new_commits
|
||||
run: |
|
||||
nss_packages_repo_latest_commit_sha=$(curl -sL "https://api.github.com/repos/${{ env.NSS_PACKAGES_REPOSITORY }}/commits?sha=${{ env.NSS_PACKAGES_REPOSITORY_BRANCH }}&per_page=1" | jq -r '.[0].sha')
|
||||
nss_packages_repo_last_built_commit_sha=$(curl -sL "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.body' | grep -oP 'NSS Packages Commit: \K\w+' || echo '')
|
||||
echo "new_commits=$([[ "$nss_packages_repo_latest_commit_sha" != "$nss_packages_repo_last_built_commit_sha" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT
|
||||
echo "latest_commit_sha=$nss_packages_repo_latest_commit_sha" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: Build OpenWRT for AX3600
|
||||
@@ -93,7 +101,7 @@ jobs:
|
||||
|
||||
release:
|
||||
name: Create release
|
||||
needs: [build]
|
||||
needs: [build, check_commits]
|
||||
if: needs.build.result == 'success'
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
@@ -116,6 +124,7 @@ jobs:
|
||||
body: |
|
||||
Updated prebuilt images for ${{ env.RELEASE_DATE }}
|
||||
Build Commit: ${{ needs.check_commits.outputs.latest_commit_sha }}
|
||||
NSS Packages Commit: ${{ needs.check_commits.outputs.nss_packages_repo_latest_commit_sha }}
|
||||
|
||||
- name: Clean up old releases
|
||||
uses: dev-drprasad/delete-older-releases@master
|
||||
|
||||
8
.github/workflows/bpi-r4.yaml
vendored
8
.github/workflows/bpi-r4.yaml
vendored
@@ -1,5 +1,5 @@
|
||||
---
|
||||
# Based on https://github.com/glassd00r/Openwrt_Builder/tree/main
|
||||
# Based on https://github.com/JuliusBairaktaris/Qualcommax_NSS_Builder/blob/main/.github/workflows/build.yaml
|
||||
name: Build OpenWRT for Banana Pi R4
|
||||
|
||||
on:
|
||||
@@ -27,7 +27,9 @@ jobs:
|
||||
|
||||
- name: Get the latest commit SHA
|
||||
id: get_sha
|
||||
run: echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
run: |
|
||||
echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
echo "latest_commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: Build OpenWRT for BPI-R4
|
||||
@@ -92,7 +94,7 @@ jobs:
|
||||
|
||||
release:
|
||||
name: Create release
|
||||
needs: [build]
|
||||
needs: [build, check_commits]
|
||||
if: needs.build.result == 'success'
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
|
||||
Reference in New Issue
Block a user