This GitHub Action checks the technology used in the project (Python, Node.js, or Maven), performs a build operation, and then uploads the resulting build artifacts. The artifacts are retained for a specified number of days. This action is useful for continuous integration workflows where you want to build your project and store the build output for later use or deployment.
Author: Álvaro García Pizarro
This action is intended to be used only with the GAWG workflow. It is not for commercial use and does not support collaboration. Below is an explanation of how it works, including inputs, outputs, and supported technologies.
maven
, python
, and node
.Validate Technology: The action first validates the specified technology to ensure it is one of the supported options (maven
, python
, node
).
Generate Artifact Name: It generates a unique artifact name based on the project name, technology, and the current timestamp.
Set Up Environment: Depending on the specified technology, it sets up the appropriate environment:
actions/setup-java@v4
.actions/setup-python@v5
.actions/setup-node@v4
.Build Project: It performs the build operation for the specified technology:
mvn clean install
.pip
and builds the project.npm
and builds the project.Create Artifact: Finally, it uploads the build artifacts using actions/upload-artifact@v4
, with the retention period specified in the config JSON.
name: Build and Upload Artifacts
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run GAWG Build Action
uses: ./
with:
technology: 'python'
config-json: '{"PROJECT_NAME":"gawg","RETENTION_DAYS":"1","JAVA_VERSION":"8","PYTHON_VERSION":"3.10","NODE_VERSION":"18","NODE_DIST_DIR":"dist/","PYTHON_DIST_DIR":"./","JAVA_DIST_DIR":"target/","JAVA_DISTRIBUTION":"temurin"}'
This example demonstrates how to use the GAWG Build Action in a GitHub Actions workflow. It checks out the code, runs the build action with the specified technology and configuration, and uploads the resulting artifacts.