Repository navigation
72 lines (64 loc) · 2.59 KB
/
Copy pathrelease.yml
File metadata and controls
72 lines (64 loc) · 2.59 KB
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
# Publish a GitHub Release with ios3ds-<version>.zip (built by build.yml).
# - push a tag v* -> release named after the tag
# - Actions -> release -> Run workflow -> release + tag <version> at the chosen commit
# The zip holds only our own builds + the installer scripts (docs/release.md).
name: release
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
version:
description: version / tag to create, e.g. v0.1.0
type: string
required: true
prerelease:
description: mark as pre-release
type: boolean
default: false
permissions:
contents: read
concurrency:
group: release-${{ github.event.inputs.version || github.ref_name }}
cancel-in-progress: false
jobs:
build:
uses: ./.github/workflows/build.yml
with:
version: ${{ github.event.inputs.version || github.ref_name }}
publish:
needs: build
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: release-zip
path: dist/
- name: Create the release
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ github.event.inputs.version || github.ref_name }}
PRERELEASE: ${{ github.event.inputs.prerelease }}
run: |
zip="dist/ios3ds-$VERSION.zip"
test -f "$zip"
(cd dist && sha256sum "ios3ds-$VERSION.zip") | tee "$zip.sha256" # bare file name: sha256sum -c works after download
cat > notes.md <<EOF
Stock iOS 4.2.1 on the Nintendo 3DS. **How to install: [README → Install](https://github.com/${GITHUB_REPOSITORY}/blob/${VERSION}/README.md#install)**
\`ios3ds-$VERSION.zip\` contains only this project's own builds (3DS payload, Homebrew Launcher app, kernel shim, our iOS programs) and the installer. You supply the iPod touch 2G firmware \`iPod2,1_4.2.1_8C148_Restore.ipsw\`; the installer turns it into the SD card files on your own PC:
python3 install.py iPod2,1_4.2.1_8C148_Restore.ipsw /path/to/your/sdcard
SHA-256: \`$(cut -d' ' -f1 "$zip.sha256")\`
EOF
flags=()
if [ "$GITHUB_EVENT_NAME" = push ]; then
flags+=(--verify-tag)
case "$VERSION" in *-*) flags+=(--prerelease) ;; esac
else
flags+=(--target "$GITHUB_SHA")
[ "$PRERELEASE" = true ] && flags+=(--prerelease)
fi
gh release create "$VERSION" "$zip" "$zip.sha256" --title "ios3ds $VERSION" \
--notes-file notes.md "${flags[@]}"