-
Notifications
You must be signed in to change notification settings - Fork 16
55 lines (48 loc) · 1.66 KB
/
Copy pathrelease.yml
File metadata and controls
55 lines (48 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- 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: Validate mod
uses: TheBrutalX/Factorio-mod-uploader-action@v2
with:
action: validate
- name: Create zip
uses: TheBrutalX/Factorio-mod-uploader-action@v2
with:
action: compress
# Workaround: compress's getInputBoolen defaults required=true, so an
# empty default trips "Input required: AUTO_UPDATE_VERSION". Pass it
# explicitly to disable the (info.json-irrelevant) auto-version bump.
auto-update-version: "false"
- name: Publish GitHub Release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
files: ${{ env.ZIP_FILE }}
draft: false
prerelease: false