forked from wwjjbb/Luna-II
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b27513d
commit 2caeb4d
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
name: Release | ||
|
||
jobs: | ||
build: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build project | ||
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 | ||
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}" | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$#" -eq 0 ]]; then | ||
echo "Usage: release.sh VERSION [OPTION]..." | ||
exit 0 | ||
fi | ||
|
||
VERSION=${1#v} | ||
VERSION=${VERSION:?Must provide version number.} | ||
shift | ||
|
||
git tag v${VERSION} $@ | ||
sed -Eie 's#"Version": "[0-9.]+",#"Version": "'"${VERSION}"'",#' package/metadata.json |