forked from wwjjbb/Luna-II
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (55 loc) · 1.75 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
on:
push:
tags:
- 'v*'
name: Release
env:
IMAGE_NAME: libplasma
jobs:
build:
name: Release
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies with buildah
run: |
ctr=$(buildah from "archlinux")
buildah config \
--cmd /usr/bin/bash $ctr
buildah run "$ctr" -- pacman \
--noconfirm -Syu
buildah run "$ctr" -- pacman \
--noconfirm -Sy \
libplasma gcc make cmake extra-cmake-modules
buildah commit -- "$ctr" "$IMAGE_NAME"
buildah rm "$ctr"
- name: Build project using podman
id: build_project
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "path=Luna3-${VERSION}.plasmoid" >> "$GITHUB_OUTPUT"
sed -Eie 's#"Version": "[0-9.]+",#"Version": "${{ github.ref }}",#' package/metadata.json
sed -Eie 's#refs/tags/v##' package/metadata.json
podman run \
--mount type=bind,src=${GITHUB_WORKSPACE},dst=/root/,Z \
--workdir=/root/ \
"$IMAGE_NAME" \
make plasmoid
- name: Create Release
id: create_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
title: Release ${{ github.ref_name }}
tag: ${{ github.ref_name }}
run: gh release create ${tag} -t "${title}"
- name: Upload Release Asset
id: upload-release-asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
asset_path: ${{ steps.build_project.outputs.path }}
run: gh release upload ${tag} "${asset_path}"