Skip to content

Commit

Permalink
release asset changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Hamel committed Mar 30, 2023
1 parent b8c5b7f commit c8e6bba
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 36 deletions.
116 changes: 81 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@ jobs:
id: get-pbs-binaries
run:
mkdir rpms/;
curl -L -k -o rpms/hwloc-libs-1.11.9-3.el8.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2.0.4/hwloc-libs-1.11.9-3.el8.x86_64.rpm;
curl -L -k -o rpms/openpbs-client-20.0.1-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2.0.0/openpbs-client-20.0.1-0.x86_64.rpm;
curl -L -k -o rpms/openpbs-execution-20.0.1-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2.0.0/openpbs-execution-20.0.1-0.x86_64.rpm;
curl -L -k -o rpms/openpbs-server-20.0.1-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2.0.0/openpbs-server-20.0.1-0.x86_64.rpm;
curl -L -k -o rpms/pbspro-client-18.1.4-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2.0.0/pbspro-client-18.1.4-0.x86_64.rpm;
curl -L -k -o rpms/pbspro-debuginfo-18.1.4-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2.0.0/pbspro-debuginfo-18.1.4-0.x86_64.rpm;
curl -L -k -o rpms/pbspro-execution-18.1.4-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2.0.0/pbspro-execution-18.1.4-0.x86_64.rpm;
curl -L -k -o rpms/pbspro-server-18.1.4-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2.0.0/pbspro-server-18.1.4-0.x86_64.rpm;
curl -L -k -o rpms/cyclecloud_api-8.3.1-py2.py3-none-any.whl https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//cyclecloud_api-8.3.1-py2.py3-none-any.whl;
curl -L -k -o rpms/hwloc-libs-1.11.9-3.el8.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//hwloc-libs-1.11.9-3.el8.x86_64.rpm;
curl -L -k -o rpms/openpbs-client-20.0.1-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//openpbs-client-20.0.1-0.x86_64.rpm;
curl -L -k -o rpms/openpbs-client-22.05.11-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//openpbs-client-22.05.11-0.x86_64.rpm;
curl -L -k -o rpms/openpbs-execution-20.0.1-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//openpbs-execution-20.0.1-0.x86_64.rpm;
curl -L -k -o rpms/openpbs-execution-22.05.11-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//openpbs-execution-22.05.11-0.x86_64.rpm;
curl -L -k -o rpms/openpbs-server-20.0.1-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//openpbs-server-20.0.1-0.x86_64.rpm;
curl -L -k -o rpms/openpbs-server-22.05.11-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//openpbs-server-22.05.11-0.x86_64.rpm;
curl -L -k -o rpms/pbspro-client-18.1.4-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//pbspro-client-18.1.4-0.x86_64.rpm;
curl -L -k -o rpms/pbspro-debuginfo-18.1.4-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//pbspro-debuginfo-18.1.4-0.x86_64.rpm;
curl -L -k -o rpms/pbspro-execution-18.1.4-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//pbspro-execution-18.1.4-0.x86_64.rpm;
curl -L -k -o rpms/pbspro-server-18.1.4-0.x86_64.rpm https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins//pbspro-server-18.1.4-0.x86_64.rpm;

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -46,6 +51,8 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: true


- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
Expand All @@ -56,9 +63,21 @@ jobs:
asset_path: dist/cyclecloud-pbspro-pkg-${{ steps.get_version.outputs.version }}.tar.gz
asset_name: cyclecloud-pbspro-pkg-${{ steps.get_version.outputs.version }}.tar.gz
asset_content_type: application/gzip


- name: Upload cyclecloud_api-8.3.1-py2.py3-none-any.whl;
id: upload-1
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/cyclecloud_api-8.3.1-py2.py3-none-any.whl
asset_name: cyclecloud_api-8.3.1-py2.py3-none-any.whl;
asset_content_type: application/octet-stream

- name: Upload hwloc-libs-1.11.9-3.el8.x86_64.rpm;
id: upload-hwloc-libs
id: upload-2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -67,9 +86,9 @@ jobs:
asset_path: rpms/hwloc-libs-1.11.9-3.el8.x86_64.rpm
asset_name: hwloc-libs-1.11.9-3.el8.x86_64.rpm;
asset_content_type: application/octet-stream

- name: Upload openpbs-client-20.0.1-0.x86_64.rpm;
id: upload-pbspro-binary-0
id: upload-3
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -79,75 +98,102 @@ jobs:
asset_name: openpbs-client-20.0.1-0.x86_64.rpm;
asset_content_type: application/octet-stream


- name: Upload openpbs-execution-20.0.1-0.x86_64.rpm
id: upload-pbspro-binary-1
- name: Upload openpbs-client-22.05.11-0.x86_64.rpm;
id: upload-4
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/openpbs-client-22.05.11-0.x86_64.rpm
asset_name: openpbs-client-22.05.11-0.x86_64.rpm;
asset_content_type: application/octet-stream

- name: Upload openpbs-execution-20.0.1-0.x86_64.rpm;
id: upload-5
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/openpbs-execution-20.0.1-0.x86_64.rpm
asset_name: openpbs-execution-20.0.1-0.x86_64.rpm
asset_name: openpbs-execution-20.0.1-0.x86_64.rpm;
asset_content_type: application/octet-stream

- name: Upload openpbs-execution-22.05.11-0.x86_64.rpm;
id: upload-6
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/openpbs-execution-22.05.11-0.x86_64.rpm
asset_name: openpbs-execution-22.05.11-0.x86_64.rpm;
asset_content_type: application/octet-stream


- name: Upload openpbs-server-20.0.1-0.x86_64.rpm
id: upload-pbspro-binary-2
- name: Upload openpbs-server-20.0.1-0.x86_64.rpm;
id: upload-7
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/openpbs-server-20.0.1-0.x86_64.rpm
asset_name: openpbs-server-20.0.1-0.x86_64.rpm
asset_name: openpbs-server-20.0.1-0.x86_64.rpm;
asset_content_type: application/octet-stream

- name: Upload openpbs-server-22.05.11-0.x86_64.rpm;
id: upload-8
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/openpbs-server-22.05.11-0.x86_64.rpm
asset_name: openpbs-server-22.05.11-0.x86_64.rpm;
asset_content_type: application/octet-stream


- name: Upload pbspro-client-18.1.4-0.x86_64.rpm
id: upload-pbspro-binary-3
- name: Upload pbspro-client-18.1.4-0.x86_64.rpm;
id: upload-9
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/pbspro-client-18.1.4-0.x86_64.rpm
asset_name: pbspro-client-18.1.4-0.x86_64.rpm
asset_name: pbspro-client-18.1.4-0.x86_64.rpm;
asset_content_type: application/octet-stream


- name: Upload pbspro-debuginfo-18.1.4-0.x86_64.rpm
id: upload-pbspro-binary-4
- name: Upload pbspro-debuginfo-18.1.4-0.x86_64.rpm;
id: upload-10
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/pbspro-debuginfo-18.1.4-0.x86_64.rpm
asset_name: pbspro-debuginfo-18.1.4-0.x86_64.rpm
asset_name: pbspro-debuginfo-18.1.4-0.x86_64.rpm;
asset_content_type: application/octet-stream


- name: Upload pbspro-execution-18.1.4-0.x86_64.rpm
id: upload-pbspro-binary-5
- name: Upload pbspro-execution-18.1.4-0.x86_64.rpm;
id: upload-11
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/pbspro-execution-18.1.4-0.x86_64.rpm
asset_name: pbspro-execution-18.1.4-0.x86_64.rpm
asset_name: pbspro-execution-18.1.4-0.x86_64.rpm;
asset_content_type: application/octet-stream


- name: Upload pbspro-server-18.1.4-0.x86_64.rpm
id: upload-pbspro-binary-6
- name: Upload pbspro-server-18.1.4-0.x86_64.rpm;
id: upload-12
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/pbspro-server-18.1.4-0.x86_64.rpm
asset_name: pbspro-server-18.1.4-0.x86_64.rpm
asset_name: pbspro-server-18.1.4-0.x86_64.rpm;
asset_content_type: application/octet-stream

97 changes: 97 additions & 0 deletions generate_release_yaml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
from subprocess import check_output
from configparser import ConfigParser
import os

RELEASE_URL = (
"https://github.com/Azure/cyclecloud-pbspro/releases/download/2023-03-29-bins/"
)
RELEASE_URL = RELEASE_URL.rstrip("/") + "/"


BASE_TEMPLATE = """# Based on example from https://github.com/actions/upload-release-asset
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '2*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Upload Release Asset
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build pkg
run:
sudo apt update || apt update;
sudo apt-get install -y python3 python3-pip || apt-get install -y python3 python3-pip;
pip3 install virtualenv;
python3 -m virtualenv $GITHUB_WORKSPACE/.venv/;
source $GITHUB_WORKSPACE/.venv/bin/activate && python package.py;
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Get PBS binaries
id: get-pbs-binaries
run:
mkdir rpms/;
%(get_pbs_binaries)s
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/cyclecloud-pbspro-pkg-${{ steps.get_version.outputs.version }}.tar.gz
asset_name: cyclecloud-pbspro-pkg-${{ steps.get_version.outputs.version }}.tar.gz
asset_content_type: application/gzip
%(upload_steps)s
"""

DOWNLOAD_LINE = f"curl -L -k -o rpms/%(fname)s {RELEASE_URL}/%(fname)s;"

UPLOAD_TEMPLATE = """
- name: Upload %(fname)s;
id: upload-%(index)s
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: rpms/%(fname)s
asset_name: %(fname)s;
asset_content_type: application/octet-stream"""
cwd = os.path.abspath(os.path.dirname(__file__))
os.chdir(cwd)

parser = ConfigParser()
parser.read("project.ini")
blobs = [x.strip() for x in parser.get("blobs", "Files").split(",")]

get_pbs_binaries = []
upload_steps = []
for n, fname in enumerate(blobs):
if "cyclecloud" in fname and "-pkg" in fname:
continue
get_pbs_binaries.append(DOWNLOAD_LINE % {"fname": fname})
upload_steps.append(UPLOAD_TEMPLATE % {"fname": fname, "index": n})

print(BASE_TEMPLATE % {"get_pbs_binaries": "\n ".join(get_pbs_binaries), "upload_steps": "\n".join(upload_steps)})
2 changes: 1 addition & 1 deletion project.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version = 2.0.19
autoupgrade = true

[blobs]
Files = cyclecloud-pbspro-pkg-2.0.19.tar.gz, cyclecloud_api-8.3.1-py2.py3-none-any.whl, hwloc-libs-1.11.9-3.el8.x86_64.rpm, openpbs-client-20.0.1-0.x86_64.rpm, openpbs-client-22.05.11-0.x86_64.rpm, openpbs-client_22.05.11-1_amd64_ubuntu18.04.deb, openpbs-client_22.05.11-1_amd64_ubuntu20.04.deb, openpbs-execution-20.0.1-0.x86_64.rpm, openpbs-execution-22.05.11-0.x86_64.rpm, openpbs-execution_22.05.11-1_amd64_ubuntu18.04.deb, openpbs-execution_22.05.11-1_amd64_ubuntu20.04.deb, openpbs-server-20.0.1-0.x86_64.rpm, openpbs-server-22.05.11-0.x86_64.rpm, openpbs-server_22.05.11-1_amd64_ubuntu18.04.deb, openpbs-server_22.05.11-1_amd64_ubuntu20.04.deb, pbspro-client-18.1.4-0.x86_64.rpm, pbspro-debuginfo-18.1.4-0.x86_64.rpm, pbspro-execution-18.1.4-0.x86_64.rpm, pbspro-server-18.1.4-0.x86_64.rpm
Files = cyclecloud-pbspro-pkg-2.0.19.tar.gz, cyclecloud_api-8.3.1-py2.py3-none-any.whl, hwloc-libs-1.11.9-3.el8.x86_64.rpm, openpbs-client-20.0.1-0.x86_64.rpm, openpbs-client-22.05.11-0.x86_64.rpm, openpbs-execution-20.0.1-0.x86_64.rpm, openpbs-execution-22.05.11-0.x86_64.rpm, openpbs-server-20.0.1-0.x86_64.rpm, openpbs-server-22.05.11-0.x86_64.rpm, pbspro-client-18.1.4-0.x86_64.rpm, pbspro-debuginfo-18.1.4-0.x86_64.rpm, pbspro-execution-18.1.4-0.x86_64.rpm, pbspro-server-18.1.4-0.x86_64.rpm

[spec server]
run_list = role[pbspro_server_role]
Expand Down

0 comments on commit c8e6bba

Please sign in to comment.