-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (72 loc) · 2.49 KB
/
release.yml
File metadata and controls
88 lines (72 loc) · 2.49 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
name: Release Modpack Build
on:
push:
tags:
- 'v*'
env:
ARCHIVE_REPO: GregTechLite/website
ARCHIVE_BRANCH: main
ARCHIVE_BASE_URL: https://gregtechlite.morphismmc.com/archives
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v34
- name: Restore Nix store cache
uses: nix-community/cache-nix-action/restore@v7
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
- name: Load devShell
uses: rrbutani/use-nix-shell-action@v1
with:
devShell: .#default
- name: Resolve metadata
run: bash .github/scripts/meta.sh
- name: Validate release tag
run: |
expected_tag="v${VERSION}"
if [ "${GITHUB_REF_NAME}" != "${expected_tag}" ]; then
echo >&2 "Tag ${GITHUB_REF_NAME} does not match pack version ${expected_tag}"
exit 1
fi
- name: Prepare archive
run: bash .github/scripts/archive.sh
- name: Package client
id: package
run: bash .github/scripts/client.sh "${SLUG}-${VERSION}"
- name: Package server
id: package_server
run: bash .github/scripts/server.sh "${SLUG}-${VERSION}" "${ARCHIVE_BASE_URL}/releases/${VERSION}/pack.toml"
- name: Deploy release archive
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.MANIFEST_DEPLOY_KEY }}
external_repository: ${{ env.ARCHIVE_REPO }}
publish_branch: ${{ env.ARCHIVE_BRANCH }}
publish_dir: archive
destination_dir: archives/releases/${{ env.VERSION }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: "Release ${{ env.VERSION }}"
- name: Publish release
uses: ncipollo/release-action@v1
with:
name: Release ${{ env.VERSION }}
prerelease: false
makeLatest: true
artifacts: |
${{ steps.package.outputs.curseforge_zip }}
${{ steps.package_server.outputs.server_zip }}
generateReleaseNotes: true