Skip to content

Commit b8baee2

Browse files
committed
CI: publish as a framework-dependent app
1 parent 2ec163d commit b8baee2

4 files changed

Lines changed: 76 additions & 34 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,32 @@ jobs:
3535
name: changelog-section.md
3636
path: ./changelog-section.md
3737

38+
- name: Set up .NET SDK
39+
uses: actions/setup-dotnet@v4
40+
with:
41+
dotnet-version: 8.0.x
42+
- name: NuGet cache
43+
uses: actions/cache@v4
44+
with:
45+
path: ${{ env.NUGET_PACKAGES }}
46+
key: ${{ runner.os }}.nuget.${{ hashFiles('**/*.fsproj') }}
47+
- name: Publish
48+
run: dotnet publish Emulsion --output publish -p:UseAppHost=false
49+
- name: Pack
50+
shell: pwsh
51+
run: Compress-Archive -Path publish -DestinationPath emulsion-${{ steps.version.outputs.version }}.zip
52+
53+
- name: Upload the pack result
54+
uses: actions/upload-artifact@v4
55+
with:
56+
path: emulsion-${{ steps.version.outputs.version }}.zip
57+
3858
- name: Create a release
3959
if: startsWith(github.ref, 'refs/tags/v')
4060
# noinspection SpellCheckingInspection
4161
uses: softprops/action-gh-release@v2
4262
with:
4363
name: Emulsion v${{ steps.version.outputs.version }}
4464
body_path: ./changelog-section.md
65+
files: |
66+
emulsion-${{ steps.version.outputs.version }}.zip

.idea/.idea.Emulsion/.idea/dictionaries/fried.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Emulsion/Emulsion.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
55
<Version>2.4.4</Version>
6+
<RollForward>Major</RollForward>
67
</PropertyGroup>
78
<ItemGroup>
89
<Compile Include="Logging.fs" />

README.md

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,50 @@ emulsion [![Docker Image][badge.docker]][docker-hub] [![Status Aquana][status-aq
33

44
emulsion is a bridge between [Telegram][telegram] and [XMPP][xmpp].
55

6+
Installation
7+
------------
8+
There are two supported Emulsion distributions: as a framework-dependent .NET application, or as a Docker image.
9+
10+
### .NET Application
11+
To run Emulsion as [a framework-dependent .NET application][docs.dotnet.framework-dependent], you'll need to [install .NET runtime][dotnet.install] version 8.0 or later.
12+
13+
Then, download the required version in the [Releases][releases] section.
14+
15+
After that, configure the application, and start it using the following shell command:
16+
17+
```console
18+
$ dotnet Emulsion.dll
19+
```
20+
21+
### Docker
22+
It is recommended to use Docker to deploy this application. To install the application from Docker, you may use the following Bash script:
23+
24+
```bash
25+
NAME=emulsion
26+
EMULSION_VERSION=latest
27+
CONFIG=/opt/codingteam/emulsion/emulsion.json
28+
DATA=/opt/codingteam/emulsion/data # optional
29+
WEB_PORT=5051 # optional
30+
docker pull codingteam/emulsion:$EMULSION_VERSION
31+
docker rm -f $NAME
32+
docker run --name $NAME \
33+
-v $CONFIG:/app/emulsion.json:ro \
34+
-v $DATA:/data \
35+
-p 127.0.0.1:$WEB_PORT:5000 \
36+
--restart unless-stopped \
37+
-d \
38+
codingteam/emulsion:$EMULSION_VERSION
39+
```
40+
41+
where
42+
43+
- `$NAME` is the container name
44+
- `$EMULSION_VERSION` is the image version you want to deploy, or `latest` for
45+
the latest available one
46+
- `$CONFIG` is the **absolute** path to the configuration file
47+
- `$DATA` is the absolute path to the data directory (used by the configuration)
48+
- `$WEB_PORT` is the port on the host system which will be used to access the content proxy
49+
650
Build
751
-----
852

@@ -104,37 +148,8 @@ Requires [.NET Runtime][dotnet] version 8.0 or newer.
104148
$ dotnet run --project ./Emulsion [optional-path-to-json-config-file]
105149
```
106150

107-
Docker
108-
------
109-
It is recommended to use Docker to deploy this project. To install the
110-
application from Docker, you may use the following Bash script:
111-
112-
```bash
113-
NAME=emulsion
114-
EMULSION_VERSION=latest
115-
CONFIG=/opt/codingteam/emulsion/emulsion.json
116-
DATA=/opt/codingteam/emulsion/data # optional
117-
WEB_PORT=5051 # optional
118-
docker pull codingteam/emulsion:$EMULSION_VERSION
119-
docker rm -f $NAME
120-
docker run --name $NAME \
121-
-v $CONFIG:/app/emulsion.json:ro \
122-
-v $DATA:/data \
123-
-p 127.0.0.1:$WEB_PORT:5000 \
124-
--restart unless-stopped \
125-
-d \
126-
codingteam/emulsion:$EMULSION_VERSION
127-
```
128-
129-
where
130-
131-
- `$NAME` is the container name
132-
- `$EMULSION_VERSION` is the image version you want to deploy, or `latest` for
133-
the latest available one
134-
- `$CONFIG` is the **absolute** path to the configuration file
135-
- `$DATA` is the absolute path to the data directory (used by the configuration)
136-
- `$WEB_PORT` is the port on the host system which will be used to access the content proxy
137-
151+
Docker Publish
152+
--------------
138153
To build and push the container to Docker Hub, use the following commands:
139154

140155
```console
@@ -162,15 +177,17 @@ Developer documentation:
162177
- [Maintainership][docs.maintainership]
163178

164179
[andivionian-status-classifier]: https://github.com/ForNeVeR/andivionian-status-classifier#status-aquana-
180+
[badge.docker]: https://img.shields.io/docker/v/codingteam/emulsion?sort=semver
165181
[docker-hub]: https://hub.docker.com/r/codingteam/emulsion
166182
[docs.changelog]: ./CHANGELOG.md
167183
[docs.create-migration]: ./docs/create-migration.md
184+
[docs.dotnet.framework-dependent]: https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent
168185
[docs.license]: ./LICENSE.md
169186
[docs.maintainership]: MAINTAINERSHIP.md
187+
[dotnet.install]: https://dot.net
170188
[dotnet]: https://dotnet.microsoft.com/download
171189
[hashids.net]: https://github.com/ullmark/hashids.net
190+
[releases]: https://github.com/codingteam/emulsion/releases
191+
[status-aquana]: https://img.shields.io/badge/status-aquana-yellowgreen.svg
172192
[telegram]: https://telegram.org/
173193
[xmpp]: https://xmpp.org/
174-
175-
[badge.docker]: https://img.shields.io/docker/v/codingteam/emulsion?sort=semver
176-
[status-aquana]: https://img.shields.io/badge/status-aquana-yellowgreen.svg

0 commit comments

Comments
 (0)