Skip to content

0.4.0: First round of fixes #89

0.4.0: First round of fixes

0.4.0: First round of fixes #89

Workflow file for this run

name: CI/CD
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
strategy:
matrix:
include:
- platform: modrinth
fileFormat: mrpack
mime: application/x-modrinth-modpack+zip
- platform: curseforge
fileFormat: zip
mime: application/zip
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rrbutani/use-nix-shell-action@v1
with:
file: shell.nix
- name: Set Version for Artifact
run: deno run -A mod.ts set ${{ github.event.release.tag_name || '0.0.0' }}
- name: Export Modpack
run: packwiz ${{ matrix.platform }} export
- name: Rename to Release-Friendly Name
run: mv "Realliance Community-${{ github.event.release.tag_name || '0.0.0' }}.${{ matrix.fileFormat }}" "${{ matrix.platform }}_${{ github.event.release.tag_name || '0.0.0' }}.${{ matrix.fileFormat }}"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-export
path: ${{ matrix.platform }}_${{ github.event.release.tag_name || '0.0.0' }}.${{ matrix.fileFormat }}
- name: Upload to Release
if: github.event_name == 'release'
uses: JasonEtco/upload-to-release@master
with:
args: ./${{ matrix.platform }}_${{ github.event.release.tag_name || '0.0.0' }}.${{ matrix.fileFormat }} ${{ matrix.mime }}
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
docker-serve:
if: github.event_name == 'release'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@6d6eaf34518db036006be0b031c21fd4eb72ef69
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-serve
- name: Build and push Docker image
uses: docker/build-push-action@9f6f8c940b91232557f8699b21341a08624a8dce
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.event.release.tag_name }}
publish-modrinth:
needs:
- build
- docker-serve
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download Modrinth Artifact
uses: actions/download-artifact@v4
with:
name: modrinth-export
- name: List Artifact
run: ls -R
- name: Generate Changelog File
run: echo "${{ github.event.release.body }}" > CHANGELOG.release.md
- name: Publish to Modrinth
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: znT0Z7tA
modrinth-token: "${{ secrets.MODRINTH_TOKEN }}"
loaders: fabric
game-versions: "1.20.1"
changelog-file: CHANGELOG.release.md
files: "*.mrpack"
version: ${{ github.event.release.tag_name }}
version-type: release
#publish-curseforge:
# needs: build
# if: github.event_name == 'release'
# runs-on: ubuntu-latest
# steps:
# - name: Download Curseforge Artifact
# uses: actions/download-artifact@v4
# with:
# name: curseforge-export
# - name: List Artifact
# run: ls -R
# - name: Generate Changelog File
# run: echo "${{ github.event.release.body }}" > CHANGELOG.release.md
# - name: Publish to Curseforge
# uses: Kir-Antipov/mc-publish@v3.3
# with:
# curseforge-id: 964927
# curseforge-token: "${{ secrets.CURSEFORGE_TOKEN }}"
# loaders: fabric
# game-versions: "1.20.1"
# changelog-file: CHANGELOG.release.md
# files: "*.zip"
# version: ${{ github.event.release.tag_name }}
# version-type: release