Skip to content

Commit

Permalink
feat(ci): start implementing semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicGD committed Aug 13, 2021
1 parent ca56d42 commit 22fb887
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 44 deletions.
57 changes: 13 additions & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,24 @@
name: Build
name: Release

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
release:
name: Release
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
env:
ADMIN_PROJECT: BioEngine.Admin
steps:
- name: Checkout code
uses: actions/checkout@v2.3.4
- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v1.8.1
- name: Checkout
uses: actions/checkout@v2
with:
dotnet-version: '6.0.x'
include-prerelease: true
- name: Install node.js
uses: actions/setup-node@v2.4.0
fetch-depth: 0
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
node-version: '15'
cache: 'npm'
cache-dependency-path: |
src/${{ env.ADMIN_PROJECT }}/Web/package.json
- name: Build admin js
working-directory: src/${{ env.ADMIN_PROJECT }}/Web
shell: bash
run: |
npm ci
npm run prod
- name: Publish admin
run: dotnet publish src/${{ env.ADMIN_PROJECT }}/${{ env.ADMIN_PROJECT }}.csproj -o /app/ -c Release
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build admin image
uses: docker/build-push-action@v2
with:
file: ./src/${{ env.ADMIN_PROJECT }}/Dockerfile
context: /app
push: false
tags: ${{ steps.prep.outputs.tags }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1 change: 1 addition & 0 deletions BioEngine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ProjectSection(SolutionItems) = preProject
README.md = README.md
docker-compose.yml = docker-compose.yml
global.json = global.json
release.config.js = release.config.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{B9D9FA15-5475-403B-B068-7ADE19C93E85}"
Expand Down
25 changes: 25 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
verifyConditions: ['@semantic-release/github'],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md"]
}
],
'@semantic-release/github'
],
branches: [
'+([0-9])?(.{+([0-9]),x}).x',
'main',
{ name: 'beta', prerelease: true },
]
};

0 comments on commit 22fb887

Please sign in to comment.