Skip to content

Commit

Permalink
CI Updates (#697)
Browse files Browse the repository at this point in the history
* updated GHActions to latest versions

* fix root margin

* reordering and fix duplication

* release fixing
  • Loading branch information
matt2005 authored Jan 5, 2025
1 parent ee18e60 commit 4e5c87e
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 150 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/crankshaft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4
with:
submodules: true
-
name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1.2.0
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
-
name: Upload build artifacts
id: upload_deploy
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: deploy
path: |
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Download artifact
uses: actions/download-artifact@v4.1.8
uses: actions/download-artifact@v4
with:
name: deploy
-
Expand Down
272 changes: 138 additions & 134 deletions .github/workflows/pifile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,32 @@ jobs:
steps:
-
name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4
-
name: Get the version
id: get_version
run: |
if [ -z "$version" ]
then
version=$(date '+%Y%m%d')
echo ::set-output name=version::"${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
else
echo ::set-output name=version::"${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
fi
builddate=$(date '+%Y-%m-%d')
buildbranch='crankshaft-ng'
buildhash=$(git rev-parse --short "$GITHUB_SHA")
buildname="${builddate}-${buildbranch}-${buildhash}"
echo ::set-output name=version::${version}
echo ::set-output name=buildhash::${buildhash}
echo ::set-output name=buildbranch::${buildbranch}
echo ::set-output name=builddate::${builddate}
echo ::set-output name=buildname::${buildname}
echo "version=${version}" >> $GITHUB_OUTPUT
echo "buildhash=${buildhash}" >> $GITHUB_OUTPUT
echo "buildbranch=${buildbranch}" >> $GITHUB_OUTPUT
echo "builddate=${builddate}" >> $GITHUB_OUTPUT
echo "buildname=${buildname}" >> $GITHUB_OUTPUT
env:
version: ${{ github.event.inputs.version }}
build:
outputs:
version: ${{ steps.get_version.outputs.version }}
runs-on: ${{ matrix.host }}
needs: [ version ]
strategy:
Expand Down Expand Up @@ -68,7 +70,7 @@ jobs:
steps:
-
name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4
-
name: Get the version
id: get_version
Expand All @@ -77,169 +79,171 @@ jobs:
then
osname=${ostype}_${osname}
fi
echo ::set-output name=version::"${version}-${osname}-${arch}"
echo "version=${version}-${osname}-${arch}" >> $GITHUB_OUTPUT
env:
version: ${{needs.version.outputs.version }}
arch: ${{ matrix.config.arch }}
ostype: ${{ matrix.config.ostype }}
osname: ${{ matrix.config.osname }}
-
name: Create Base Image
uses: Nature40/[email protected]
uses: Nature40/pimod@v0.6.1 #v0.5.0
with:
pifile: ${{ matrix.config.basefile }}.Pifile
-
name: Rename Image
run: mv ${{ matrix.config.basefile }}.img crankshaft-${{needs.version.outputs.buildname }}.img
run: mv ${{ matrix.config.basefile }}.img ${{steps.get_version.outputs.version}}.img
-
name: Package zip
id: packagezip
run: |
IMG_FILENAME="crankshaft-${{needs.version.outputs.buildname }}.img"
ZIP_FILENAME="crankshaft-${{needs.version.outputs.buildname }}.zip"
IMG_FILENAME="${{steps.get_version.outputs.version}}.img"
ZIP_FILENAME="${{steps.get_version.outputs.version}}.zip"
MD5HASH="${IMG_FILENAME}.md5"
SHA1HASH="${IMG_FILENAME}.sha1"
SHA256HASH="${IMG_FILENAME}.sha256"
md5sum "${IMG_FILENAME}" > "${MD5HASH}"
sha1sum "${IMG_FILENAME}" > "${SHA1HASH}"
sha256sum "${IMG_FILENAME}" > "${SHA256HASH}"
zip "${ZIP_FILENAME}" "${IMG_FILENAME}" "${MD5HASH}" "${SHA1HASH}" "${SHA256HASH}"
echo ::set-output name=ZIP_FILENAME::"${ZIP_FILENAME}"
echo ::set-output name=MD5HASH::"${MD5HASH}"
echo ::set-output name=SHA1HASH::"${SHA1HASH}"
echo ::set-output name=SHA256HASH::"${SHA256HASH}"
echo "ZIP_FILENAME=${ZIP_FILENAME}" >> $GITHUB_OUTPUT
echo "MD5HASH=${MD5HASH}" >> $GITHUB_OUTPUT
echo "SHA1HASH=${SHA1HASH}" >> $GITHUB_OUTPUT
echo "SHA256HASH=${SHA256HASH}" >> $GITHUB_OUTPUT
-
name: Upload build artifacts
id: upload_deploy
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_version.outputs.version }}
path: |
${{ steps.packagezip.outputs.ZIP_FILENAME }}
${{ steps.packagezip.outputs.MD5HASH }}
${{ steps.packagezip.outputs.SHA1HASH }}
${{ steps.packagezip.outputs.SHA256HASH }}
# Create Release
release:
runs-on: ubuntu-latest
needs: [ version, build ]
name: 'Create release'
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
steps:
-
name: Build Changelog
id: github_release
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Create GitHub release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
tag_name: ${{needs.version.outputs.version }}
release_name: ${{needs.version.outputs.buildname }}
#body: ${{steps.github_release.outputs.changelog}}
draft: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.packagezip.outputs.ZIP_FILENAME }}
asset_name: ${{ steps.packagezip.outputs.ZIP_FILENAME }}
tag: ${{needs.version.outputs.version }}
latest: false
prerelease: true
#draft: true
#body: ${{steps.github_release.outputs.changelog}}
# Create Release
# release:
# runs-on: ubuntu-latest
# needs: [ version, build ]
# name: 'Create release'
# outputs:
# release_upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# steps:
# -
# name: Build Changelog
# id: github_release
# uses: mikepenz/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# -
# name: Create GitHub release
# id: create_release
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{needs.version.outputs.version }}
# release_name: ${{needs.version.outputs.buildname }}
# #body: ${{steps.github_release.outputs.changelog}}
# draft: true
# prerelease: true
# Upload release artifacts
upload:
needs: [ version, build, release ]
runs-on: ${{ matrix.host }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
host: [
"ubuntu-latest",
#"macos-10.15",
]
config:
- {
name: "Debian Buster armhf",
basefile: "base_buster_armhf",
arch: "armhf",
osname: "buster",
ostype: "Debian"
}
- {
name: "Debian Buster arm7",
basefile: "updater/base_buster_arm7",
arch: "arm7",
osname: "buster",
ostype: "Debian"
}

name: 'Upload release: ${{ matrix.config.name }}'
steps:
-
name: Download build artifacts
uses: actions/[email protected]
with:
name: ${{ steps.get_version.outputs.version }}

-
name: Get Artifact Filenames
id: getfilenames
run: |
IMG_FILENAME="crankshaft-${{needs.version.outputs.buildname }}.img"
ZIP_FILENAME="crankshaft-${{needs.version.outputs.buildname }}.zip"
MD5HASH="${IMG_FILENAME}.md5"
SHA1HASH="${IMG_FILENAME}.sha1"
SHA256HASH="${IMG_FILENAME}.sha256"
zip "${ZIP_FILENAME}" "${IMG_FILENAME}" "${MD5HASH}" "${SHA1HASH}" "${SHA256HASH}"
echo ::set-output name=ZIP_FILENAME::"${ZIP_FILENAME}"
echo ::set-output name=MD5HASH::"${MD5HASH}"
echo ::set-output name=SHA1HASH::"${SHA1HASH}"
echo ::set-output name=SHA256HASH::"${SHA256HASH}"
-
name: Upload zip to release
id: upload_zip
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ needs.version.outputs.buildname }}
with:
upload_url: ${{needs.release.outputs.release_upload_url}}
asset_path: ${{ steps.getfilenames.outputs.ZIP_FILENAME }}
asset_name: ${{ steps.getfilenames.outputs.ZIP_FILENAME }}
asset_content_type: application/zip
-
name: Upload md5 to release
id: upload_md5
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ needs.version.outputs.buildname }}
with:
upload_url: ${{needs.release.outputs.release_upload_url}}
asset_path: ${{ steps.getfilenames.outputs.MD5HASH }}
asset_name: ${{ steps.getfilenames.outputs.MD5HASH }}
asset_content_type: text/plain
-
name: Upload sha1 to release
id: upload_sha1
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ needs.version.outputs.buildname }}
with:
upload_url: ${{needs.release.outputs.release_upload_url}}
asset_path: ${{ steps.getfilenames.outputs.SHA1HASH }}
asset_name: ${{ steps.getfilenames.outputs.SHA1HASH }}
asset_content_type: text/plain
-
name: Upload sha256 to release
id: upload_sha256
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ needs.version.outputs.buildname }}
with:
upload_url: ${{needs.release.outputs.release_upload_url}}
asset_path: ${{ steps.getfilenames.outputs.SHA256HASH }}
asset_name: ${{ steps.getfilenames.outputs.SHA256HASH }}
asset_content_type: text/plain
# upload:
# needs: [ version, build, release ]
# runs-on: ${{ matrix.host }}
# strategy:
# fail-fast: false
# max-parallel: 3
# matrix:
# host: [
# "ubuntu-latest",
# #"macos-10.15",
# ]
# config:
# - {
# name: "Debian Buster armhf",
# basefile: "updater/base_buster_armhf",
# arch: "armhf",
# osname: "buster",
# ostype: "Debian"
# }
# - {
# name: "Debian Buster arm7",
# basefile: "updater/base_buster_arm7",
# arch: "arm7",
# osname: "buster",
# ostype: "Debian"
# }
# steps:
# -
# name: Get the version
# id: get_version
# run: |
# if [ -n "$ostype" ]
# then
# osname=${ostype}_${osname}
# fi
# echo "version=${version}-${osname}-${arch}" >> $GITHUB_OUTPUT
# env:
# version: ${{needs.version.outputs.version }}
# arch: ${{ matrix.config.arch }}
# ostype: ${{ matrix.config.ostype }}
# osname: ${{ matrix.config.osname }}
# -
# name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: ${{ steps.get_version.outputs.version }}
# - name: Upload binaries to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{ steps.get_version.outputs.version }}/${{ steps.get_version.outputs.version }}.zip
# asset_name: ${{ steps.get_version.outputs.version }}.zip
# tag: ${{ steps.get_version.outputs.version }}
# release_name: ${{needs.version.outputs.buildname }}
# draft: true
# - name: Upload MD5 to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: target/release/${{ steps.get_version.outputs.version }}.img.md5
# asset_name: ${{ steps.get_version.outputs.version }}.img.md5
# tag: ${{ github.ref }}
# release_name: ${{needs.version.outputs.buildname }}
# draft: true
# - name: Upload SHA1 to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: target/release/${{ steps.get_version.outputs.version }}.img.sha1
# asset_name: ${{ steps.get_version.outputs.version }}.img.sha1
# tag: ${{ github.ref }}
# release_name: ${{needs.version.outputs.buildname }}
# draft: true
# - name: Upload SHA256 to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: target/release/${{ steps.get_version.outputs.version }}.img.sha256
# asset_name: ${{ steps.get_version.outputs.version }}.img.sha256
# tag: ${{ github.ref }}
# release_name: ${{needs.version.outputs.buildname }}
# draft: true
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
stale-issue-label: 'no-issue-activity'
exempt-issue-labels: 'awaiting-approval,work-in-progress,dontclose,documentation,security,pinned,future-enhancement,enhancement'
close-issue-message: 'This issue was closed because it has been stalled for 60 days with no activity.'
days-before-issue-close: 0
days-before-issue-close: 30
days-before-issue-stale: 120
exempt-all-pr-assignees: true
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
Expand Down
Loading

0 comments on commit 4e5c87e

Please sign in to comment.