Release triggered by shiva-patt-oss #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π Release | |
run-name: Release triggered by ${{ github.actor }} | |
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
tags: | |
- "v**" | |
jobs: | |
build: | |
name: π Build | |
runs-on: ubuntu-latest | |
container: | |
image: rebornos/rebornos:latest | |
ports: | |
- 80 | |
steps: | |
- name: π Initialize RebornOS Docker Container | |
id: init_docker_step | |
run: sh /usr/bin/init-rebornos-docker.sh | |
- name: π Checkout Git Repository | |
id: checkout_repository_step | |
uses: actions/checkout@v3 | |
- name: π Build Package | |
id: build_package_step | |
run: | | |
chown -R rebornos packaging | |
chmod -R +x packaging | |
sudo -u rebornos sh -c "packaging/build_package.sh stable --noconfirm" | |
- name: β¬ Upload Package Artifact | |
id: upload_package_step | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Stable Package | |
path: packaging/${{ github.event.repository.name }}/${{ github.event.repository.name }}*.pkg.tar.* | |
if-no-files-found: error | |
release: | |
needs: build | |
name: π Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Checkout Git Repository | |
id: checkout_repository_step | |
uses: actions/checkout@v3 | |
- name: π· Determine Tags and Versions | |
id: set_versions_step | |
run: | | |
git fetch --prune --unshallow --tags -f | |
LATEST_TAG="$(git tag | grep -v -P '^v([0-9]+)\.([0-9]+)\.([0-9]+).*\.' | grep -v -P '^v([0-9]+)\.([0-9]+)\.([0-9]+).*\.' | grep -v -P '^v([0-9]+)\.([0-9]+)\.([0-9]+)_$' | sort --version-sort | tail -n1)" | |
GIT_VERSION="$(git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)")" | |
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV | |
echo "GIT_VERSION=$GIT_VERSION" >> $GITHUB_ENV | |
echo "LATEST_TAG=$LATEST_TAG" | |
echo "GIT_VERSION=$GIT_VERSION" | |
- name: β¬ Download Package Artifact | |
id: download_package_step | |
uses: actions/download-artifact@v3 | |
with: | |
name: Stable Package | |
path: output | |
- name: π© Generate CheckSum | |
id: generate_checksum_step | |
run: | | |
cd ${{ steps.download_package_step.outputs.download-path }} | |
find . -type f -exec sh -c 'md5sum "$0 > $0.md5sum' {} \; | |
- name: π Create Release | |
id: create_release_step | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: false | |
prerelease: false | |
fail_on_unmatched_files: true | |
generate_release_notes: false | |
append_body: false | |
body_path: CHANGELOG.md | |
tag_name: ${{ env.LATEST_TAG }} | |
name: ${{ env.LATEST_TAG }} | |
files: | | |
${{ steps.download_package_step.outputs.download-path }}/**${{ github.event.repository.name }}*.pkg.tar* |