Skip to content

ci: fix packaging of mod. #9

ci: fix packaging of mod.

ci: fix packaging of mod. #9

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Verify version
run: |
VERSION=$(jq -r .version info.json)
if [[ "${{ github.ref_name }}" != "$VERSION" ]]; then
echo "Tag name ${{ github.ref_name }} does not match version in info.json: $VERSION"
exit 1
fi
- name: Verify changelog
run: |
echo "Checking changelog for version ${{ github.ref_name }}..."
if ! grep -q "Version: ${{ github.ref_name }}" changelog.txt; then
echo "ERROR: Changelog does not contain an entry for version ${{ github.ref_name }}"
exit 1
fi
echo "Changelog verification successful!"
- name: Create Factorio mod package
id: package_mod
uses: Roang-zero1/factorio-mod-package@master
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.package_mod.outputs.asset_path }}
asset_name: creative-mod_${{ github.ref_name }}.zip
asset_content_type: application/zip