diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d91e273..aced70f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 }} diff --git a/BioEngine.sln b/BioEngine.sln index fcb50b7..cc27f27 100644 --- a/BioEngine.sln +++ b/BioEngine.sln @@ -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}" diff --git a/release.config.js b/release.config.js new file mode 100644 index 0000000..f78d876 --- /dev/null +++ b/release.config.js @@ -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 }, + ] +};