Merge pull request #450 from harsh97/main #1
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
# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. | |
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. | |
# | |
# Creates and Publishes the Oracle Resource Manager stack - v0.0.5 | |
name: Generate stacks and publish release | |
on: | |
push: | |
branches: [ main ] | |
paths: ['VERSION'] | |
jobs: | |
publish_stack: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Create stacks | |
id: create_stacks | |
run: | | |
STACKNAME=oci-ods-aqua | |
STACK_FILES="ai-quick-actions/policies/terraform/*" | |
RELEASE=$(cat VERSION) | |
ASSETS+="${STACKNAME}.zip" | |
echo "::group::Processing $STACKNAME" | |
zip -r ${STACKNAME}-stack.zip $STACK_FILES || { printf '\n⛔ Unable to create %s stack.\n'; exit 1; } | |
cp ${STACKNAME}-stack.zip ${STACKNAME}.zip || { printf '\n⛔ Unable to create %s stack.\n'; exit 1; } | |
echo "::endgroup::" | |
echo "::set-output name=assets::$ASSETS" | |
echo "::set-output name=release::$RELEASE" | |
echo "::set-output name=prefix::$STACKNAME" | |
- name: Prepare Release Notes | |
run: | | |
# | |
printf '%s\n' '${{ steps.create_stacks.outputs.prefix }} Stack - v${{ steps.create_stacks.outputs.release }}' >release.md | |
printf '%s\n' '' '## [![Deploy to Oracle Cloud][magic_button]][magic_stack]' >>release.md | |
printf '%s\n' '' '' >>release.md | |
printf '%s\n' '' '[magic_button]: https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg' >>release.md | |
printf '%s\n' '' '[magic_stack]: https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/${{ github.repository }}/releases/download/${{ steps.create_stacks.outputs.release }}/${{ steps.create_stacks.outputs.prefix }}.zip' >>release.md | |
- name: Create Release | |
run: gh release create ${{ steps.create_stacks.outputs.release }} --generate-notes -F release.md ${{ steps.create_stacks.outputs.assets }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |