This repository has been archived by the owner on Aug 4, 2024. It is now read-only.
Release #68
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
debug_release: | |
type: boolean | |
description: "Whether if we are creating a debug release" | |
ci_run_id: | |
description: "Run ID of the desired CI run to download artifacts from" | |
required: true | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
id: download-artifact | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
workflow: ci.yaml | |
workflow_conclusion: success | |
run_id: ${{ github.event.inputs.ci_run_id }} | |
path: artifacts | |
skip_unpack: true | |
- name: Extract source package | |
run: | | |
cd artifacts | |
unzip -j srcpkg.zip 'magiskboot_*-src.tar.xz' | |
file magiskboot_*-src.tar.xz | |
rm -f srcpkg.zip | |
- name: Clean up old releases (Debug) | |
if: github.event.inputs.debug_release == 'true' | |
uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 0 | |
delete_tags: true | |
delete_tag_pattern: last-debug-ci | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clean up old releases (Release) | |
if: github.event.inputs.debug_release != 'true' | |
uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 0 | |
delete_tags: true | |
delete_tag_pattern: last-ci | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Wait for 3s | |
run: | | |
# prevent github to think our release already exists and create us a draft | |
sleep 3 | |
- name: Create release (Debug) | |
if: github.event.inputs.debug_release == 'true' | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Last debug CI build | |
target_commitish: dev | |
tag_name: last-debug-ci | |
body_path: ${{ github.workspace }}/.github/__debug_release_template.md | |
draft: false | |
prerelease: true | |
fail_on_unmatched_files: true | |
files: | | |
artifacts/magiskboot_*-src.tar.xz | |
artifacts/*.zip | |
- name: Create release (Release) | |
if: github.event.inputs.debug_release != 'true' | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Last CI build | |
target_commitish: dev | |
tag_name: last-ci | |
body_path: ${{ github.workspace }}/.github/__release_template.md | |
draft: false | |
prerelease: false | |
fail_on_unmatched_files: true | |
files: | | |
artifacts/magiskboot_*-src.tar.xz | |
artifacts/*.zip |