-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (79 loc) · 2.76 KB
/
nightly.yml
File metadata and controls
96 lines (79 loc) · 2.76 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Nightly Modpack Build
on:
push:
env:
MANIFEST_REPO: GregTechLite/gregtechlite.github.io
MANIFEST_BRANCH: test
MANIFEST_BASE_URL: https://gregtechlite.github.io
permissions:
contents: write
concurrency:
group: nightly-${{ github.ref }}
cancel-in-progress: true
jobs:
nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Install Nix
uses: cachix/install-nix-action@v31
- name: Load devShell
uses: rrbutani/use-nix-shell-action@v1
with:
devShell: .#default
- name: Resolve metadata
run: bash .github/scripts/meta.sh
- name: Prepare manifest
run: bash .github/scripts/manifest.sh
- name: Package client
id: package
run: bash .github/scripts/client.sh "${SLUG}-nightly"
- name: Package server
id: package_server
run: bash .github/scripts/server.sh "${SLUG}-nightly" "${MANIFEST_BASE_URL}/nightly/pack.toml"
- name: Prepare nightly metadata
id: nightly_meta
run: |
short_sha="${GITHUB_SHA::7}"
echo "label=Nightly ${short_sha}" >> "$GITHUB_OUTPUT"
echo "artifact_name=${SLUG}-nightly-${short_sha}" >> "$GITHUB_OUTPUT"
- name: Deploy nightly manifest
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.MANIFEST_DEPLOY_KEY }}
external_repository: ${{ env.MANIFEST_REPO }}
publish_branch: ${{ env.MANIFEST_BRANCH }}
publish_dir: dist/manifest
destination_dir: nightly
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
- name: Update nightly tag
run: |
git tag -f nightly "${GITHUB_SHA}"
git push origin refs/tags/nightly --force
- name: Publish nightly release
uses: softprops/action-gh-release@v2
with:
tag_name: nightly
target_commitish: ${{ github.sha }}
name: ${{ steps.nightly_meta.outputs.label }}
body: ${{ steps.nightly_meta.outputs.label }}
prerelease: true
make_latest: false
files: |
${{ steps.package.outputs.curseforge_zip }}
${{ steps.package_server.outputs.server_zip }}
overwrite_files: true
fail_on_unmatched_files: true
- name: Upload nightly artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.nightly_meta.outputs.artifact_name }}
path: |
${{ steps.package.outputs.curseforge_zip }}
${{ steps.package_server.outputs.server_zip }}
if-no-files-found: error