Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

docs(readme): 更新專案資訊 #268

docs(readme): 更新專案資訊

docs(readme): 更新專案資訊 #268

name: CI | Pack - Release Please
on:
push:
branches:
- "main"
workflow_dispatch: {}
permissions:
actions: write
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release-please:
name: Release Please
if: github.repository == 'TeamKugimiya/ModsTranslationPack'
runs-on: ubuntu-latest
steps:
- name: Checking Repository
uses: actions/checkout@v4
- name: Release Please
id: release_please
uses: googleapis/release-please-action@v4
with:
config-file: .github/configs/release-please-config.json
manifest-file: .github/configs/.release-please-manifest.json
outputs:
release_created: ${{ steps.release_please.outputs.release_created }}
tag_name: ${{ steps.release_please.outputs.tag_name }}
matrix-setup:
name: Setup Matrix
if: ${{ needs.release-please.outputs.release_created }}
needs: [ release-please ]
uses: ./.github/workflows/Reusable-MatrixSetup.yml
pack-release:
name: Pack ${{ matrix.version }}
if: ${{ needs.release-please.outputs.release_created }}
needs: [ release-please, matrix-setup ]
strategy:
matrix: ${{ fromJson(needs.matrix-setup.outputs.matrix) }}
uses: ./.github/workflows/Reusable-ResourcePacker.yml
with:
ref: ${{ needs.release-please.outputs.tag_name }}
matrix_version: ${{ matrix.version }}
release: true
release_version: ${{ needs.release-please.outputs.tag_name }}
secrets:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_ENDPOINT: ${{ secrets.AWS_S3_ENDPOINT }}
summary:
name: Generate Summary
if: ${{ needs.release-please.outputs.release_created }}
needs: [ release-please, pack-release ]
uses: ./.github/workflows/Reusable-Summary.yml
make-changelog:
name: Make Changelog
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
needs: [ release-please ]
outputs:
changelogs: ${{ steps.changelog.outputs.changelog }}
steps:
- name: Make Changelog
id: changelog
run: |
Tags=${{ needs.release-please.outputs.tag_name }}
{
echo 'changelog<<EOF'
curl https://api.github.com/repos/TeamKugimiya/ModsTranslationPack/releases/tags/$Tags -H "Accept: application/vnd.github+json" | jq -r .body
echo EOF
} >> "$GITHUB_OUTPUT"
release-upload:
name: Release Upload
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
needs: [ release-please, pack-release ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checking Repository
uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.tag_name }}
fetch-depth: 0
- name: Download All Artifact
uses: actions/download-artifact@v4
- name: Upload Release Artifact
run: |
for i in ModsTranslationPack-*
do
cd "$i" || exit 1
sha256sum -c checksum.txt
cat checksum.txt >> ../checksums.txt
gh release upload ${{ needs.release-please.outputs.tag_name }} $i.zip
cd ..
done
gh release upload ${{ needs.release-please.outputs.tag_name }} checksums.txt
modrinth-publish:
name: Modrinth Release ${{ matrix.version }}
needs: [ release-please, matrix-setup, make-changelog, summary ]
strategy:
max-parallel: 1
matrix: ${{ fromJson(needs.matrix-setup.outputs.matrix) }}
uses: ./.github/workflows/Reusable-ModrinthPublish.yml
with:
matrix_version: ${{ matrix.version }}
changelog: |
${{ needs.make-changelog.outputs.changelogs }}
---
${{ needs.summary.outputs.build_info }}
release: true
version: ${{ needs.release-please.outputs.tag_name }}
secrets:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
delete-artifact:
name: Delete Artifact
needs: [ modrinth-publish ]
uses: ./.github/workflows/Reusable-DeleteArtifact.yml
with:
artifact_name: ModsTranslationPack-*