feat: test #46
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Mod | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Install dependencies | |
run: npm install -g commit-and-tag-version | |
- name: Commit and Tag Version | |
run: | | |
commit-and-tag-version | |
chmod +x ./conventional_to_factorio_changelog.sh | |
cat CHANGELOG.md | ./conventional_to_factorio_changelog.sh > changelog.txt.new | |
echo "$(cat changelog.txt.new)" | |
cat changelog.txt >> changelog.txt.new | |
mv changelog.txt.new changelog.txt | |
- name: Package mod | |
run: | | |
MOD_NAME=$(jq -r .name info.json) | |
MOD_VERSION=$(jq -r .version info.json) | |
echo "Mod name: $MOD_NAME" | |
echo "Mod version: $MOD_VERSION" | |
zip -r "$MOD_NAME-$MOD_VERSION.zip" . -x "*.git*" -x "*.github*" | |
echo "MOD_FILE=$MOD_NAME-$MOD_VERSION.zip" >> $GITHUB_ENV | |
echo "Mod file: $MOD_FILE" | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.NEXT_VERSION }} | |
release_name: v${{ env.NEXT_VERSION }} | |
body: ${{ steps.generate_changelog.outputs.formatted_changelog }} | |
draft: ${{ github.ref != 'refs/heads/master' }} | |
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: ${{ env.MOD_FILE }} | |
asset_name: ${{ env.MOD_FILE }} | |
asset_content_type: application/zip |