Skip to content

Commit e38139d

Browse files
authored
Merge pull request #2 from xbmbmx/1-automation-add-a-pipeline-and-auto-release
1 automation add a pipeline and auto release
2 parents 04d4094 + 8c339c0 commit e38139d

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
on:
2+
push:
3+
branches: main
4+
tags:
5+
- '*'
6+
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
container: skylyrac/blocksds:slim-v1.6.3
12+
name: "Build"
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v1
16+
- name: Compile and build
17+
run: |
18+
make
19+
mkdir out
20+
mv poweroff.nds out
21+
- name: Publish
22+
uses: actions/upload-artifact@v4
23+
with:
24+
path: "out/*"
25+
name: out
26+
27+
publish:
28+
runs-on: ubuntu-latest
29+
name: Upload to release
30+
if: $({ success() && startsWith(github.ref, 'refs/tags') })
31+
needs: out
32+
steps:
33+
- name: Download built artifacts
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: out
37+
path: out
38+
- name:
39+
if:
40+
run: |
41+
ID=$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)
42+
43+
for file in ${{ github.workspace }}/build/*; do
44+
AUTH_HEADER="Authorization: token ${{ secrets.GITHUB_TOKEN }}"
45+
CONTENT_LENGTH="Content-Length: $(stat -c%s $file)"
46+
CONTENT_TYPE="Content-Type: application/7z-x-compressed"
47+
UPLOAD_URL="https://uploads.github.com/repos/${{ github.repository }}/releases/$ID/assets?name=$(basename $file)"
48+
49+
curl -XPOST -H "$AUTH_HEADER" -H "$CONTENT_LENGTH" -H "$CONTENT_TYPE" --upload-file "$file" "$UPLOAD_URL"
50+
done
51+

readme.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,18 @@
33
A _very_ simple application that shuts your console off.
44

55
Built with [BlocksDS](https://github.com/blocksds/sdk).
6+
7+
## Installation
8+
9+
Head over to the [release tags section](https://github.com/xbmbmx/nds-poweroff/tags) of this repository and download the latest `poweroff.nds` file.
10+
11+
To use this application, simply boot it using your favourite launcher.
12+
If loaded correctly, this application should power your device off.
13+
14+
## Purpose
15+
16+
I created this application to power off the console without having to use the power button.
17+
18+
It can be used as a `BOOT.nds` file for homebrew applications that use it to go back to the launcher. Using `poweroff.nds` as a BOOT.nds file will cause these types of homebrew to turn the console of instead of returning to a launcher.
19+
20+
Take note that for this to work, you may need to adapt your Unlauch settings to no longer use `BOOT.nds` when no buttons are held, as that would cause your console to immediately turn off after booting.

0 commit comments

Comments
 (0)