-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updated GHActions to latest versions * fix root margin * reordering and fix duplication * release fixing
- Loading branch information
Showing
6 changed files
with
226 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -68,7 +70,7 @@ jobs: | |
steps: | ||
- | ||
name: Checkout repository | ||
uses: actions/checkout@v1 | ||
uses: actions/checkout@v4 | ||
- | ||
name: Get the version | ||
id: get_version | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.