Skip to content

Commit

Permalink
Test for a release workflow that actually builds a complete packadge
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde committed Aug 21, 2024
1 parent 2f39362 commit 9fb0302
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 70 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/container-workflows.yaml

This file was deleted.

61 changes: 51 additions & 10 deletions .github/workflows/release-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,95 @@ name: Release Workflow
on: [push]

jobs:
release-managment:
release-management:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }} # checkout the correct branch name
fetch-depth: 0 # fetch the whole repo history
ref: ${{ github.head_ref }} # Checkout the correct branch name
fetch-depth: 0 # Fetch the whole repo history
# Documentation: https://github.com/actions/checkout
# Explanation: This step checks out the source code from the GitHub repository, ensuring that the workflow has access to the latest version of the code.

#Based on https://github.com/marketplace/actions/git-version
# Step 2: Install Node.js dependencies using npm
- name: Install npm dependencies
uses: actions/setup-node@v3
with:
node-version: '18.x' # Specify Node.js version
# Documentation: https://github.com/actions/setup-node
# Explanation: This step sets up a Node.js environment and installs the project's dependencies listed in the `package.json` file using npm.

- run: npm install
# Documentation: https://docs.npmjs.com/cli/v7/commands/npm-install
# Explanation: This step runs `npm install` to install the Node.js dependencies required for the project.

# Step 3: Install PHP dependencies using Composer
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
php_version: '7.4' # Specify PHP version if needed
# Documentation: https://github.com/php-actions/composer
# Explanation: This step sets up Composer in the GitHub Actions environment and installs the PHP dependencies listed in the `composer.json` file.

- run: composer install --no-progress --no-interaction --prefer-dist
# Documentation: https://getcomposer.org/doc/03-cli.md#install
# Explanation: This step runs `composer install` to install the PHP dependencies required for the project without any interactive prompts and with optimized autoloading.

# Step 4: Generate Git version information
- name: Git Version
id: version
uses: codacy/[email protected]
with:
release-branch: main
# Documentation: https://github.com/marketplace/actions/git-version
# Explanation: This step calculates the version of the software based on the Git tags and branch information, storing the result in the `version` output.

# Step 5: Extract repository description
- name: Extract repository description
id: repo-description
run: |
description=$(jq -r '.description' <(curl -s https://api.github.com/repos/${{ github.repository }}))
echo "REPO_DESCRIPTION=$description" >> $GITHUB_ENV
# Documentation: https://docs.github.com/en/rest/reference/repos#get-a-repository
# Explanation: This step retrieves the description of the GitHub repository using the GitHub API and stores it in the environment variables.

#https://github.com/saadmk11/changelog-ci
# Step 6: Run Changelog CI
- name: Run Changelog CI
uses: saadmk11/[email protected]
with:
release_version: ${{ steps.version.outputs.version }}
config_file: changelog-ci-config.json
# Documentation: https://github.com/saadmk11/changelog-ci
# Explanation: This step generates a changelog for the current release using the Changelog CI tool.

# Step 7: Output the version
- name: Use the version
run: |
echo ${{ steps.version.outputs.version }}
# Explanation: This step outputs the calculated version number to the console for reference.

#https://github.com/marketplace/actions/zip-release
# Step 8: Archive the release files
- name: Archive Release
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'release.zip'
exclusions: '*.git* *.vscode* .coverage-frontend* .docker* .tests* .specs.ts* .mocks.ts* .tests* .editorconfig .eslintrc.js .phpmd.xml .phpunit.xml .psalm.xml .eslintrc.js stylelint.config.js webpack.config.js'
exclusions: '*.git* *.vscode* .coverage-frontend* .docker* .tests* .specs.ts* .mocks.ts* .tests* .editorconfig .eslintrc.js .phpmd.xml .phpunit.xml .psalm.xml .eslintrc.js stylelint.config.js webpack.config.js'
# Documentation: https://github.com/marketplace/actions/zip-release
# Explanation: This step creates a zip archive of the repository, excluding certain files and directories as specified.

#https://github.com/marvinpinto/action-automatic-releases
- uses: "marvinpinto/action-automatic-releases@latest"
# Step 9: Create a new release on GitHub
- name: Create GitHub Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.version.outputs.version }}
prerelease: false
title: "Release ${{ steps.version.outputs.version }}"
files: |
LICENSE.md
release.zip
release.zip
# Documentation: https://github.com/marvinpinto/action-automatic-releases
# Explanation: This step creates a new release on GitHub, uploading the generated release files, and tagging the release with the calculated version.

0 comments on commit 9fb0302

Please sign in to comment.