-
Notifications
You must be signed in to change notification settings - Fork 41
116 lines (112 loc) · 4.14 KB
/
release.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Release
on:
release:
types: [published]
workflow_dispatch: {}
jobs:
update-autorevision:
name: "Update AutoRevision"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- # Make sure there are no unstaged changes
# Was reporting changes to eol=crlf files in .gitattributes
run: git checkout -- .
- run: git rev-parse --short=5 HEAD > cmake/AutoRevision.txt
- run: git describe --tags `git rev-list --tags --max-count=1` >> cmake/AutoRevision.txt
- run: cat cmake/AutoRevision.txt
- name: Find target branch
id: branch
# We're running on a tag so have no direct access to the branch. Find it.
# Strip the first 3 components (ref/remotes/username)
run: |
branch=$(git branch -r --contains HEAD --format '%(refname:strip=3)')
echo Target branch is $branch
echo branch=$branch >> $GITHUB_OUTPUT
- name: Problem file cleanup
# We have this problematic file that we need to remove
run: |
rm dist/freeciv21-server.cmd
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
base: ${{ steps.branch.outputs.branch }}
commit-message: "Release update of AutoRevision.txt"
branch: release/autorevision/${{ steps.branch.outputs.branch }}
title: "Release update of AutoRevision.txt"
body: >
Automatic changes triggered by a new release.
This PR updates `${{ steps.branch.outputs.branch }}`.
Close and reopen this pull request to start the CI.
delete-branch: true
update-archive:
name: "Update Source Archive"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- # Make sure there are no unstaged changes
# Was reporting changes to eol=crlf files in .gitattributes
run: git checkout -- .
- run: git rev-parse --short=5 HEAD > cmake/AutoRevision.txt
- run: git describe --tags `git rev-list --tags --max-count=1` >> cmake/AutoRevision.txt
- run: cat cmake/AutoRevision.txt
- name: Make build directory
run: mkdir -p -v $PWD/build
- name: Create tar.gz
run: |
tar --exclude='build' --exclude='data/graphics' -cvzf Freeciv21-${{github.ref_name}}.tar.gz ../freeciv21/*
sha256sum --binary Freeciv21-${{github.ref_name}}.tar.gz > Freeciv21-${{github.ref_name}}.tar.gz.sha256
- name: Create zip
run: |
cd ..
zip -r freeciv21/Freeciv21-${{github.ref_name}}.zip freeciv21/* -x \*/build/* \*.gz \*.sha256 \*/data/graphics/* \*/.*
cd freeciv21
sha256sum --binary Freeciv21-${{github.ref_name}}.zip > Freeciv21-${{github.ref_name}}.zip.sha256
- name: Upload package
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
Freeciv21-${{github.ref_name}}.tar.gz
Freeciv21-${{github.ref_name}}.tar.gz.sha256
Freeciv21-${{github.ref_name}}.zip
Freeciv21-${{github.ref_name}}.zip.sha256
snapcraft:
name: "Snap Package"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install \
cmake \
ninja-build \
gettext \
qtbase5-dev \
libqt5svg5-dev \
libkf5archive-dev \
liblua5.3-dev \
libsqlite3-dev \
libsdl2-mixer-dev
- name: Configure
run: |
mkdir -p build/snap/local
cmake . -B build -G Ninja
cp data/icons/128x128/freeciv21-client.png build/snap/local
- uses: snapcore/action-build@v1
id: snapcraft
with:
path: build
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ steps.snapcraft.outputs.snap }}
release: beta