Skip to content

Commit

Permalink
feat: Implement GitHub release publishing
Browse files Browse the repository at this point in the history
Signed-off-by: 林博仁(Buo-ren Lin) <[email protected]>
  • Loading branch information
brlin-tw committed Oct 29, 2023
1 parent 6e87030 commit f8f462b
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Release product and their build aritfacts
#
# References:
#
# * Workflow syntax for GitHub Actions - GitHub Docs
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
# Copyright 2023 林博仁(Buo-ren, Lin) <[email protected]>
# SPDX-License-Identifier: CC-BY-SA-4.0
name: Release product and their build aritfacts
on:
push:
tags:
- v*.*.*

jobs:
release:
name: Release product and their build aritfacts
runs-on: ubuntu-20.04
steps:
- name: Checkout content from the Git repository
uses: actions/checkout@v4

- name: Determine the project identifier
run: printf "project_id=${GITHUB_REPOSITORY##*/}\\n" >> $GITHUB_ENV

- name: Determine the name of the Git tag
run: printf "release_tag=${GITHUB_REF##*/}\\n" >> $GITHUB_ENV

- name: Determine the release version string
run: printf "release_version=${release_tag#v}\\n" >> $GITHUB_ENV

- name: Determine the release identifier
run: printf "release_id=${project_id}-${release_version}\\n" >> $GITHUB_ENV

- name: Generate the release archive
run: >-
git archive
--prefix="${release_id}/"
--output="${release_id}.tar.gz"
"${release_tag}"
- name: Publish the release archive to the GitHub Releases
uses: softprops/[email protected]
with:
name: ${{ env.project_id }} ${{ env.release_version }}
files: |
${{ env.release_id }}.tar*

0 comments on commit f8f462b

Please sign in to comment.