Skip to content

Commit

Permalink
CI: tag release versions with commit count + hash
Browse files Browse the repository at this point in the history
The format is `rnumberOfCommits.latestCommitHash`, i.e. `r23.a33dc14`. The repo has to be cloned with the whole commit history (not shallow) to get to number of commits, which is what `fetch-depth` does.
  • Loading branch information
Redecorating authored Jul 9, 2021
1 parent fc1255b commit 8436f21
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'

- name: Install dependency
run: |
sudo apt-get update
Expand All @@ -21,12 +24,19 @@ jobs:
- name: make
run: |
make
- name: generate tag
id: tag
run: |
count=$(git rev-list --count HEAD)
hash=$(git rev-parse --short HEAD)
echo "::set-output name=tag::r${count}.${hash}"
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
automatic_release_tag: "${{ steps.tag.outputs.tag }}"
prerelease: false
title: "Release"
title: "Release ${{ steps.tag.outputs.tag }}"
files: |
*.efi

0 comments on commit 8436f21

Please sign in to comment.