Release #2
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: | |
# push: | |
# branches: | |
# - main | |
workflow_dispatch: | |
inputs: | |
pve_version: | |
required: true | |
default: "8.2-2" | |
description: Proxmox VE version | |
type: string | |
pve_sha256: | |
required: true | |
default: "c96ad84eacbbcef299ab8f407f9602f832abb5ceb08a9aa288c1e1164df2da97" | |
description: Proxmox VE SHA256 | |
type: string | |
jobs: | |
release: | |
name: ISO release | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
permissions: | |
contents: write | |
packages: write | |
env: | |
COMMIT_SHORT_SHA: null | |
PROXMOX_VERSION: ${{ inputs.pve_version }} | |
PROXMOX_ISO_SHA: ${{ inputs.pve_sha256 }} | |
steps: | |
- name: Checkout from repository | |
uses: actions/[email protected] | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build auto install ISO from Proxmox VE | |
uses: naa0yama/proxmox-auto-install-iso@v1 | |
with: | |
pve_version: ${{ env.PROXMOX_VERSION }} | |
pve_sha256: ${{ env.PROXMOX_ISO_SHA }} | |
- name: Cleanup pre-releases | |
uses: actions/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: |+ | |
const __prereleases = await github.rest.repos.listReleases({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
per_page: 100, | |
}); | |
const prereleases = __prereleases.data | |
for (const index in prereleases) { | |
if (prereleases[index].prerelease == true || prereleases[index].draft == true) { | |
console.log('delete ' + prereleases[index]['id'] + '\t' + prereleases[index]['name']) | |
await github.rest.repos.deleteRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: prereleases[index]['id'], | |
}); | |
} | |
} | |
console.log('end run') | |
- name: Calculate the sha256sum | |
working-directory: dist | |
run: |+ | |
set -eux | |
sha256sum proxmox-ve_${PROXMOX_VERSION}_auto_* > sha256sum.txt | |
ls -lah . | |
- name: Pre-Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Proxmox VE ${{ env.PROXMOX_VERSION }} ${{ env.COMMIT_SHORT_SHA }} | |
tag_name: ${{ env.COMMIT_SHORT_SHA }} | |
generate_release_notes: true | |
draft: true | |
prerelease: false | |
make_latest: true | |
files: | | |
./dist/proxmox-ve_${{ env.PROXMOX_VERSION }}_auto_*.iso | |
./dist/sha256sum.txt |