Skip to content

deploy-release

deploy-release #1

Workflow file for this run

#
# BSD 2-Clause License
#
# Copyright (c) 2021-2024, Hewlett Packard Enterprise
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
name: deploy-release
on:
release:
types: [published]
jobs:
build_dists:
name: Build Distributions
runs-on: ubuntu-22.04
env:
SMARTSIM_SUFFIX: rc1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install build
run: python -m pip install build>=1.2.2,<2
- name: Install build-essentials
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y build-essential wget
- name: Build Distributions
run: python -m build .
- uses: actions/upload-artifact@v3
with:
name: distributables
path: ./dist/*
upload_pypi:
needs: [build_dists]
environment: personal
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v3
with:
name: distributables
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI }}
repository_url: https://test.pypi.org/legacy/
createPullRequest:
needs: [upload_pypi]
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create pull request
run: |
gh pr create -B develop \
-H master \
--title 'Merge master into develop' \
--body 'This PR brings develop up to date with master for release.'
env:
GH_TOKEN: ${{ github.token }}