Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
149 additions
and
99 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
name: build and pack | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
#pull_request: | ||
# branches: [main, develop] | ||
workflow_dispatch: | ||
inputs: | ||
# logLevel: | ||
# description: "Log level" | ||
# required: true | ||
# default: "warning" | ||
# type: choice | ||
# options: | ||
# - info | ||
# - warning | ||
# - debug | ||
push_nuget: | ||
description: "Push nuget packages" | ||
required: true | ||
type: boolean | ||
default: true | ||
push_docker: | ||
description: "Push docker images" | ||
required: true | ||
type: boolean | ||
default: true | ||
push_release: | ||
description: "Create release" | ||
required: true | ||
type: boolean | ||
default: true | ||
|
||
env: | ||
PUSH_DOCKER: ${{ inputs.push_docker || 'true' }} | ||
PUSH_NUGET: ${{ inputs.push_docker || 'true' }} | ||
PUSH_RELEASE: ${{ inputs.push_release || 'true' }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{github.workspace}}/src/Passingwind.ElsaDesigner/node_modules | ||
key: ${{ runner.os }}-yarn-cache | ||
restore-keys: | | ||
${{ runner.os }}-node | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
7.0.x | ||
- name: Install dotnet tool | ||
run: dotnet tool install -g Passingwind.Git-CI-Tools | ||
|
||
- name: Set environment vars | ||
uses: rlespinasse/github-slug-action@3.6.0 | ||
|
||
- name: Version check and generate | ||
run: | | ||
gitci release changes --output ./changeslog.md | ||
gitci version next --format json --output ./version.json --build-ver "${{env.GITHUB_SHA_SHORT}}" | ||
ls ./ | ||
- id: changes | ||
uses: dorny/paths-filter@v2 | ||
with: | ||
filters: | | ||
src: | ||
- 'src/**' | ||
- name: DotNet restore dependencies | ||
run: dotnet restore Passingwind.WorkflowApp.sln | ||
|
||
- name: DotNet build | ||
run: dotnet build --no-restore -c Release Passingwind.WorkflowApp.sln | ||
|
||
- name: DotNet pack | ||
# if: steps.changes.outputs.src == 'true' | ||
run: dotnet pack --no-build --no-restore -c Release /p:Version="${{env.GITCI_NEXT_VERSION}}" --property:PackageOutputPath=${{github.workspace}}/pack_output Passingwind.Abp.ElsaModule.sln | ||
|
||
- name: DotNet app publish | ||
# if: steps.changes.outputs.src == 'true' | ||
run: dotnet publish ./app/src/Passingwind.WorkflowApp.Web/Passingwind.WorkflowApp.Web.csproj --output ${{github.workspace}}/docker/app -c Release /p:Version="${{env.GITCI_NEXT_VERSION}}" | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- name: node yarn | ||
run: | | ||
cd ./src/Passingwind.ElsaDesigner | ||
yarn | ||
- name: npm build | ||
run: | | ||
cd ./src/Passingwind.ElsaDesigner | ||
npm run build | ||
- name: zip node assets | ||
#if: steps.changes.outputs.src == 'true' | ||
run: | | ||
cd ${{github.workspace}}/src/Passingwind.ElsaDesigner | ||
zip ${{github.workspace}}/pack_output/workflow-dashboard.zip -r ./dist/* | ||
- name: Docker | ||
#if: steps.changes.outputs.src == 'true' | ||
if: ${{ env.PUSH_DOCKER == 'true' }} | ||
run: | | ||
# copy | ||
rm -rf ${{github.workspace}}/docker/app/wwwroot/dist/ | ||
cp -r ${{github.workspace}}/src/Passingwind.ElsaDesigner/dist ${{github.workspace}}/docker/app/wwwroot/ | ||
# | ||
docker login -u ${{vars.DOCKER_USER_NAME}} -p ${{secrets.DOCKER_USER_AK}} | ||
docker build -t ${{vars.DOCKER_IMAGE_NAME}}:${{env.GITCI_NEXT_VERSION}} . | ||
docker push ${{vars.DOCKER_IMAGE_NAME}}:${{env.GITCI_NEXT_VERSION}} | ||
- name: Push dotnet package | ||
#if: steps.changes.outputs.src == 'true' | ||
if: ${{ env.PUSH_RELEASE == 'true' }} | ||
run: dotnet nuget push ./pack_output/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source https://api.nuget.org/v3/index.json | ||
|
||
- name: Create Release | ||
#if: steps.changes.outputs.src == 'true' | ||
uses: ncipollo/release-action@v1 | ||
if: ${{ env.PUSH_DOCKER == 'true' }} | ||
with: | ||
tag: v${{env.GITCI_NEXT_VERSION}} | ||
artifacts: ./changeslog*, ./pack_output/* | ||
bodyFile: ./changeslog.md | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine | ||
|
||
EXPOSE 80 | ||
|
||
# | ||
WORKDIR /app | ||
|
||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false | ||
|
||
RUN apk add --no-cache icu-libs icu-data-full krb5-libs libgcc libintl libssl1.1 libstdc++ zlib tzdata | ||
|
||
# | ||
COPY app /app | ||
|
||
ENTRYPOINT ["dotnet", "Passingwind.WorkflowApp.Web.dll"] | ||
ENTRYPOINT ["dotnet", "Passingwind.WorkflowApp.Web.dll"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# ABP & Elsa Application |
File renamed without changes.
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