Skip to content

Commit

Permalink
Add required parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderschramm1992 authored May 24, 2024
1 parent 2c53f93 commit 9777360
Showing 1 changed file with 39 additions and 32 deletions.
71 changes: 39 additions & 32 deletions .github/workflows/build_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: Reusable Build Workflow

on:
workflow_call:
inputs:
release_version:
required: true
type: string
secrets:
github_token:
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -39,35 +46,35 @@ jobs:
arguments: buildDocs

# release and deploy only if we're building a release
# - name: Prepare Deployment
# if: startsWith(github.ref, 'refs/tags/')
# run: |
# rm -rf ./build/tmp
# cp ./docs-ext/curriculum-*.pdf ./build 2>/dev/null || :
# zip -r release.zip ./build
# mkdir release_dir
# cp ./build/curriculum-*.pdf ./release_dir 2>/dev/null || :
# mv release.zip ./release_dir/release-${{ env.RELEASE_VERSION }}.zip
# - name: Create New Release
# if: startsWith(github.ref, 'refs/tags/')
# id: create-release
# uses: ncipollo/release-action@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag: ${{ env.RELEASE_VERSION }}
# name: Release ${{ env.RELEASE_VERSION }}
# draft: false
# prerelease: false
# bodyFile: "CHANGELOG.md"
# artifacts: "license-copyright/LICENSE.adoc,release_dir/*.pdf,release_dir/*.zip"
# token: ${{ secrets.GITHUB_TOKEN }}
# - name: Deploy
# if: startsWith(github.ref, 'refs/tags/')
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./build
# user_name: 'github-actions[bot]'
# user_email: 'github-actions[bot]@users.noreply.github.com'
# commit_message: Publish Release ${{ env.RELEASE_VERSION }}
- name: Prepare Deployment
if: startsWith(github.ref, 'refs/tags/')
run: |
rm -rf ./build/tmp
cp ./docs-ext/curriculum-*.pdf ./build 2>/dev/null || :
zip -r release.zip ./build
mkdir release_dir
cp ./build/curriculum-*.pdf ./release_dir 2>/dev/null || :
mv release.zip ./release_dir/release-${{ inputs.release_version }}.zip
- name: Create New Release
if: startsWith(github.ref, 'refs/tags/')
id: create-release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }} # This token is provided by Actions, you do not need to create your own token
with:
tag: ${{ inputs.release_version }}
name: Release ${{ inputs.release_version }}
draft: false
prerelease: false
bodyFile: "CHANGELOG.md"
artifacts: "license-copyright/LICENSE.adoc,release_dir/*.pdf,release_dir/*.zip"
token: ${{ secrets.github_token }}
- name: Deploy
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.github_token }}
publish_dir: ./build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: Publish Release ${{ inputs.release_version }}

0 comments on commit 9777360

Please sign in to comment.