Release VF2 Kernel #535
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
name: Release VF2 Kernel | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
workflow_call: | |
workflow_run: | |
workflows: [Build VF2 Kernel] | |
types: [completed] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
#runs-on: self-hosted | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
container: | |
image: ubuntu:latest | |
options: --user root | |
steps: | |
- name: Install dependencies | |
run: | | |
apt update | |
apt install -y curl jq unzip | |
- name: Find Artifact | |
id: find_artifact | |
run: | | |
echo "artifact_id=$(curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/agreenbhm/linux/actions/artifacts?name=compiled_vf2_debs | jq .artifacts[0].id)" >> $GITHUB_OUTPUT | |
- name: Download Artifact | |
run: | | |
curl -L -o /tmp/artifact.zip -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/agreenbhm/linux/actions/artifacts/${{ steps.find_artifact.outputs.artifact_id }}/zip | |
- name: Extract Artifact | |
run: | | |
cd /tmp/ | |
unzip artifact.zip | |
#- name: Restore Cached Debs | |
# id: cache-debs-restore | |
# uses: actions/cache@v3 | |
# with: | |
# path: /tmp/ | |
# key: "deb-cache-${{ github.run_id }}" | |
- name: Generate release tag | |
id: tag | |
run: | | |
echo "release_tag=$(basename /tmp/linux-image-* | cut -d'_' -f2)-$(date +'%Y.%m.%d_%H-%M')" >> $GITHUB_OUTPUT | |
- name: Display structure of downloaded files | |
run: | | |
cd /tmp/ | |
ls -R | |
- name: Release | |
id: release1 | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
body: Automated build of VisionFive 2 kernel .debs for Ubuntu. | |
files: | | |
/tmp/*.deb | |
- name: Re-try Release | |
id: release2 | |
if: ${{ failure() }} | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
body: Automated build of VisionFive 2 kernel .debs for Ubuntu. | |
files: | | |
/tmp/*.deb | |
- name: Re-try Release Final | |
id: release3 | |
if: ${{ failure() }} | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
body: Automated build of VisionFive 2 kernel .debs for Ubuntu. | |
files: | | |
/tmp/*.deb | |
- name: Check for success | |
if: ${{ failure() && (steps.release1.outcome == 'success' || steps.release2.outcome == 'success' || steps.release3.outcome == 'success') }} | |
run: exit 0 |