Release oee-simulators #17
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
# Release public oee-simulators | |
name: Release oee-simulators | |
on: | |
workflow_dispatch: | |
inputs: | |
release_body: | |
type: string | |
description: GitHub Release Message | |
default: "New Release" | |
environment: | |
type: environment | |
description: Name of the environment to use | |
default: "test" | |
required: true | |
jobs: | |
call-build-workflow: | |
uses: ./.github/workflows/build.yml | |
with: | |
environment: ${{ inputs.environment }} | |
secrets: | |
C8Y_PASSWORD: ${{ secrets.C8Y_PASSWORD }} | |
build-release: | |
if: github.ref == 'refs/heads/main' | |
needs: call-build-workflow | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
path: 'repo' | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: 'oee-simulators' | |
path: 'repo/simulators' | |
- name: Zip files for release | |
shell: bash | |
run: | | |
cd repo/simulators | |
if [[ ! -f image.tar ]]; then | |
echo "Missing required files: image.tar" | |
exit 1 | |
fi | |
if [[ ! -f cumulocity.json ]]; then | |
echo "Missing required files: cumulocity.json" | |
exit 1 | |
fi | |
zip oee-simulators.zip image.tar cumulocity.json | |
- name: Create Release | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: v1.0.${{ needs.call-build-workflow.outputs.release_version }} | |
tag_name: v1.0.${{ needs.call-build-workflow.outputs.release_version }} | |
body: ${{ inputs.release_body }} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload oee-sim zip | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # upload_url output is provided automatically by the GitHub API when the release is created | |
asset_path: 'repo/simulators/oee-simulators.zip' | |
asset_name: 'oee-simulators.zip' | |
asset_content_type: application/zip |