Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

Commit aa916f3

Browse files
authored
Create console-release.yml
1 parent 6cd8071 commit aa916f3

1 file changed

Lines changed: 174 additions & 0 deletions

File tree

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: flowsynx
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
rel_version:
7+
description: 'Release version (examples: 1.9.0-rc.1, 1.9.1)'
8+
required: true
9+
type: string
10+
11+
env:
12+
DOCKER_USER_NAME: ${{ github.repository_owner }}
13+
DOCKER_IMAGE_NAME: ${{ github.event.repository.name }}
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
jobs:
20+
build:
21+
strategy:
22+
matrix:
23+
os: [ubuntu-latest, windows-latest, macos-latest]
24+
os_arch: [x64, arm, arm64]
25+
include:
26+
- os: ubuntu-latest
27+
kind: linux
28+
title: linux
29+
- os: windows-latest
30+
kind: win
31+
title: windows
32+
- os: macos-latest
33+
kind: osx
34+
title: osx
35+
exclude:
36+
- os: windows-latest
37+
os_arch: arm
38+
- os: macos-latest
39+
os_arch: arm
40+
runs-on: ${{ matrix.os }}
41+
env:
42+
ARCHIVE_OUTDIR: dist/archives
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
with:
47+
fetch-depth: 0
48+
49+
- name: Install GitVersion
50+
uses: gittools/actions/gitversion/setup@v0.9.7
51+
with:
52+
versionSpec: 5.x
53+
54+
- name: Determine Version
55+
uses: gittools/actions/gitversion/execute@v0.9.7
56+
id: gitversion
57+
58+
- name: Display GitVersion outputs
59+
run: |
60+
echo "Version: ${{ inputs.rel_version }}"
61+
62+
- name: Setup .NET
63+
uses: actions/setup-dotnet@v3.2.0
64+
with:
65+
dotnet-version: 9.0.x
66+
67+
- name: Publish
68+
run: |
69+
release_name="console-${{ matrix.title }}-${{ matrix.os_arch }}"
70+
dotnet publish src/Console.csproj \
71+
-p:PublishSingleFile=true \
72+
-p:PublishReadyToRun=true \
73+
--runtime "${{ matrix.kind }}-${{ matrix.os_arch }}" \
74+
-c Release --self-contained true \
75+
-p:Version="${{ inputs.rel_version }}" \
76+
-o "${{ github.workspace }}/$release_name"
77+
78+
mkdir -p "${{ github.workspace }}/dist"
79+
cd "${{ github.workspace }}/$release_name"
80+
81+
if [[ "${{ matrix.kind }}" == "win" ]]; then
82+
7z a -tzip "${{ github.workspace }}/dist/${release_name}.zip" *
83+
else
84+
tar czvf "${{ github.workspace }}/dist/${release_name}.tar.gz" *
85+
fi
86+
87+
- name: Upload binaries
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: console-${{ matrix.title }}-${{ matrix.os_arch }}
91+
path: "${{ github.workspace }}/dist"
92+
93+
release:
94+
runs-on: ubuntu-latest
95+
needs: build
96+
if: github.ref == 'refs/heads/master'
97+
env:
98+
ARTIFACT_DIR: ./release
99+
100+
steps:
101+
- name: Download artifacts
102+
uses: actions/download-artifact@v4
103+
with:
104+
pattern: console-*
105+
path: ${{ env.ARTIFACT_DIR }}
106+
merge-multiple: true
107+
108+
- name: Generate checksums
109+
run: |
110+
cd ${ARTIFACT_DIR}
111+
for i in *; do sha256sum -b "$i" > "$i.sha256"; done
112+
113+
- name: Create Release
114+
uses: ncipollo/release-action@v1
115+
with:
116+
tag: v${{ inputs.rel_version }}
117+
name: Console v${{ inputs.rel_version }}
118+
body: "This is the v${{ inputs.rel_version }} release of FlowSynx Console"
119+
artifacts: "**/*.*"
120+
token: ${{ secrets.GH_TOKEN }}
121+
122+
- name: Create Branch
123+
uses: peterjgrainger/action-create-branch@v2.2.0
124+
env:
125+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
126+
with:
127+
branch: release-${{ inputs.rel_version }}
128+
sha: ${{ github.event.pull_request.head.sha }}
129+
130+
compute:
131+
runs-on: ubuntu-latest
132+
outputs:
133+
docker_user_name: ${{ env.DOCKER_USER_NAME }}
134+
docker_image_name: ${{ env.DOCKER_IMAGE_NAME }}
135+
136+
steps:
137+
- name: Compute Outputs
138+
run: |
139+
echo "docker_user_name=${{ env.DOCKER_USER_NAME }}" >> $GITHUB_OUTPUT
140+
echo "docker_image_name=${{ env.DOCKER_IMAGE_NAME }}" >> $GITHUB_OUTPUT
141+
142+
docker:
143+
strategy:
144+
matrix:
145+
os: [ubuntu-latest, windows-2022]
146+
include:
147+
- os: ubuntu-latest
148+
file: docker/Dockerfile.Linux
149+
tag_suffix: linux-amd64
150+
- os: windows-2022
151+
file: docker/Dockerfile.Windows
152+
tag_suffix: windows-ltsc2022-amd64
153+
runs-on: ${{ matrix.os }}
154+
needs: [compute, build, release]
155+
156+
steps:
157+
- uses: actions/checkout@v4
158+
159+
- name: Login to DockerHub
160+
uses: docker/login-action@v3
161+
with:
162+
username: ${{ secrets.DOCKER_USERNAME }}
163+
password: ${{ secrets.DOCKER_PASSWORD }}
164+
165+
- name: Build and Push Image
166+
run: |
167+
IMAGE_NAME=${{ needs.compute.outputs.docker_user_name }}/${{ needs.compute.outputs.docker_image_name }}
168+
TAG="${IMAGE_NAME}:${{ inputs.rel_version }}-${{ matrix.tag_suffix }}"
169+
170+
docker build -f ${{ matrix.file }} \
171+
--build-arg APP_VERSION=${{ inputs.rel_version }} \
172+
-t $TAG .
173+
174+
docker push $TAG

0 commit comments

Comments
 (0)