# # # @type github workflow # @desc publishes a new release # @author Aetherinox # @url https://github.com/Aetherinox # # name: "📦 Release › Publish" run-name: "📦 Release › Publish" # # # Triggers # # on: workflow_dispatch: inputs: # # # Name of the plugin to use when creating the release zip filename # e.g: tvapp2-v1.0.0.zip # # PROJECT_NAME: description: "📦 Name of App" required: true default: 'tvapp2' type: string # # # ENABLE: the changelog generated in releases tab will only display single commits. # DISABLE: the changelog shows pull requests completed based on their labels # # CHANGELOG_MODE_COMMIT: description: "📑 Use Commits Instead of PRs" required: true default: true type: boolean # # # ENABLE: Will show all types of commits, including uncategorized # DISABLE: WIll only show actions that have been categorized using the format # type(scope): description # type: description # # SHOW_UNCATEGORIZED: description: "🗂️ Show Uncategorized Commits" required: true default: false type: boolean # # # ENABLE: released version will be marked as pre-release # DISABLE: release version will be marked as stable / normal release # # PRERELEASE: description: "🧪 Build RC (Pre-release)" required: true default: false type: boolean # # # Release Candidate version number # this will be added to the end of your released app in the releases page. # e.g: tvapp2-v1.0.0-rc.1 # # VERSION_RC: description: "🧪 RC (Pre-release) Ver (tvapp2-rc.v1)" required: false type: string default: "1" # # # Jobs # # jobs: # # # Jobs › Initialize # # job-initialize: name: >- 📦 Initialize runs-on: ubuntu-latest outputs: package_version: ${{ steps.task_initialize_package_getversion.outputs.PACKAGE_VERSION }} permissions: contents: write packages: write steps: # # # Initialize › Start # # - name: "✅ Start" id: task_initialize_start run: | echo "Starting build" # # # Initialize › Set Env Variables # # - name: >- 🕛 Get Timestamp id: task_initialize_label_set_timestamp run: | echo "NOW=$(date +'%m-%d-%Y %H:%M:%S')" >> $GITHUB_ENV echo "NOW_SHORT=$(date +'%m-%d-%Y')" >> $GITHUB_ENV echo "NOW_LONG=$(date +'%m-%d-%Y %H:%M')" >> $GITHUB_ENV echo "NOW_DOCKER_LABEL=$(date +'%Y%m%d')" >> $GITHUB_ENV # # # Initialize › Checkout # # - name: "☑️ Checkout" id: task_initialize_checkout uses: actions/checkout@v4 with: fetch-depth: 0 # # # Initialize › Get version from package.json VERSION value # # - name: "👁️‍🗨️ Package Version › Set" id: task_initialize_package_getversion run: | VER=$(cat tvapp2/package.json | jq -r '.version') echo "PACKAGE_VERSION=$VER" >> $GITHUB_OUTPUT - name: "👁️‍🗨️ Package Version › Get" id: task_initialize_package_version_get run: | echo "VERSION: ${{ steps.task_initialize_package_getversion.outputs.PACKAGE_VERSION }}" # # # Job › Release › Github # # job-release: name: >- 📦 Publish › Release runs-on: ubuntu-latest needs: [ job-initialize ] env: PACKAGE_VERSION: ${{ needs.job-initialize.outputs.package_version }} outputs: guid: ${{ steps.task_release_dotenv_get.outputs.GUID }} uuid: ${{ steps.task_release_dotenv_get.outputs.UUID }} permissions: contents: write packages: write steps: # # # Release › Checkout # # - name: "☑️ Checkout" id: task_release_checkout uses: actions/checkout@v4 with: fetch-depth: 0 # # # Release › Set Env Variables # # - name: >- 🕛 Get Timestamp id: task_release_label_set_timestamp run: | echo "NOW=$(date +'%m-%d-%Y %H:%M:%S')" >> $GITHUB_ENV echo "NOW_SHORT=$(date +'%m-%d-%Y')" >> $GITHUB_ENV echo "NOW_LONG=$(date +'%m-%d-%Y %H:%M')" >> $GITHUB_ENV echo "NOW_DOCKER_LABEL=$(date +'%Y%m%d')" >> $GITHUB_ENV # # # Release › Print Version Debug # # - name: "🪪 Test Next Job Version" id: task_release_debug_print_ver run: | echo "VERSION: ${{ env.PACKAGE_VERSION }}" # # # Release › Install package via NPM # # - name: "🪪 NPM › Install" id: task_release_npm_install run: | cd ./tvapp2 npm ci env: NODE_AUTH_TOKEN: ${{ secrets.SELF_TOKEN_CL }} # # # Release › Execute npm generate so that a uuid and guid can be created # # - name: "🪪 Generate IDs" id: task_release_npm_env_generate run: | npm run root:generate # # # .ENV › Get # Get guid and uuid from env variable generated by npm # # - name: "🪪 .ENV › Get" id: task_release_dotenv_get uses: falti/dotenv-action@v1 # # # .ENV › Print (Debug) # Show guid and uuid from env variable generated by npm # # - name: "🪪 .ENV › Read" id: task_dotenv_debug_print run: | echo "GUID: ${{ steps.task_release_dotenv_get.outputs.GUID }}" echo "UUID: ${{ steps.task_release_dotenv_get.outputs.UUID }}"