From efafae85bcede70981ab6aadd0598e6a5285bfaa Mon Sep 17 00:00:00 2001 From: Chris L Date: Sun, 1 May 2022 14:09:41 +0200 Subject: [PATCH] Use repo name as artifact name to be more generic --- .github/workflows/automation.yml | 3 ++- README.md | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index a3505b3..9603e01 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -65,7 +65,8 @@ jobs: - name: Make artifact name id: make_artifactname run: | - ARTIFACT_NAME="${{ github.repository }}-${{ github.run_number }}" + echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_ENV + ARTIFACT_NAME="${{ env.REPOSITORY_NAME }}-${{ github.run_number }}" echo "${ARTIFACT_NAME}" echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV diff --git a/README.md b/README.md index 27b03e8..ea9b748 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ # Example IPK builder and Release workflow -This repo is meant as an example regarding workflows and IPK's. +This repo is meant as an example regarding workflows and IPKs. -The `Makefile` is used to build an IPK from the available data. The workflow file is meant to create a new release as soon as a new tag is pushed to the repository. It will thus trigger building the IPK and attaching it to the release. +The `Makefile` is used to build an IPK from the available `control` and `data` directories. The `automation.yml` workflow file is meant to create a new release as soon as a new tag is pushed to the repository. + +> It will thus trigger building the IPK, create a release and attaching the IPK to itt. ## Workflow Check [automation.yml](./.github/workflows/automation.yml) this file should be pretty self explanatory, there are two jobs: **build** and **release**. -Both jobs run when something is pushed to master and when new tags are pushed. The **build** job runs the `Makefile` and creates the artifact. The release file fetches the artifact and makes a new release, attaching all available IPK files as assets to the new release. +Both jobs run when something is pushed to master and when new tags are pushed. The **release** job `needs` the **build** job, so it runs first. + +It basically runs the `Makefile` and creates the artifact. The release job fetches the artifact and generates a new release, attaching all available IPK files as assets to the new release. -When pushed to master the release will be marked as **pre-release**, only when a new tag is pushed it is marked as a full release. +## Tagging +When pushed to master the release will be marked as **pre-release**, only when a new tag is pushed it is marked as a full release, the tag name will then also be the releases name.