55 lines
1.7 KiB
YAML
55 lines
1.7 KiB
YAML
name: Build and host modpack
|
|
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
build_pdf:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
cache: true
|
|
|
|
- name: Cache Packwiz Binary
|
|
id: cache-packwiz
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/go/bin/packwiz
|
|
key: ${{ runner.os }}-packwiz-binary
|
|
|
|
- name: Install Packwiz
|
|
if: steps.cache-packwiz.outputs.cache-hit != 'true'
|
|
run: go install github.com/packwiz/packwiz@latest
|
|
|
|
- name: Add GOBIN to Path
|
|
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
|
|
|
- name: Build modpack
|
|
run: |
|
|
packwiz modrinth export -o "${{ github.event.repository.name }}-modrinth.mrpack"
|
|
|
|
- name: Delete old versions
|
|
continue-on-error: true
|
|
run: |
|
|
curl -v -X DELETE -s \
|
|
-u "strawberries:${{ secrets.TOKEN }}" \
|
|
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/${{ github.event.repository.name }}/latest/${{ github.event.repository.name }}-modrinth.mrpack"
|
|
|
|
- name: Upload to Gitea Generic Packages
|
|
run: |
|
|
ls -lash
|
|
curl -v \
|
|
-u strawberries:${{ secrets.TOKEN }} \
|
|
--upload-file "${{ github.event.repository.name }}-modrinth.mrpack" \
|
|
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/${{ github.event.repository.name }}/latest/${{ github.event.repository.name }}-modrinth.mrpack"
|
|
|