forked from calamares/calamares
-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (79 loc) · 2.95 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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*