Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeago committed Apr 12, 2024
0 parents commit 4a22289
Show file tree
Hide file tree
Showing 78 changed files with 5,865 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"projectName": "buildvana-builder",
"projectOwner": "Tenacom",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "jshint",
"contributorsPerLine": 7,
"contributorsSortAlphabetically": true,
"badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat-square)](#contributors)",
"contributorTemplate": "<a href=\"<%= contributor.profile %>\"><img src=\"<%= contributor.avatar_url %>\" width=\"<%= options.imageSize %>px;\" alt=\"\"/><br /><sub><b><%= contributor.name %></b></sub></a>",
"types": {
"custom": {}
},
"linkToUsage": true,
"skipCi": true,
"contributors": [
{
"login": "rdeago",
"name": "Riccardo De Agostini",
"avatar_url": "https://avatars.githubusercontent.com/u/139223?v=4",
"profile": "https://github.com/rdeago",
"contributions": [
"doc",
"code",
"projectManagement",
"ideas",
"maintenance",
"question",
"review"
]
}
]
}
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
.github
SampleProject
26 changes: 26 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file specifies users whose review is automatically requested when a PR modifies certain files.
# For more ionformation see:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# GitHub and apps configuration files
/.github/ @rdeago
/.all-contributorsrc @rdeago

# Git configuration files
/.git* @rdeago

# Build scripts
*.cake @rdeago

# Licensing
LICENSE @rdeago
THIRD-PARTY-NOTICES @rdeago

# Solution infrastructure files
Directory.Build.* @rdeago
.editorconfig @rdeago
.globalconfig @rdeago
stylecop.json @rdeago
*.DotSettings @rdeago
NuGet.config @rdeago
version.json @rdeago
39 changes: 39 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'area:code':
- '*.sln'
- 'src/**/*'

'area:style':
- '**/.editorconfig'
- '**/.globalconfig'
- '**/stylecop.json'
- '**/*.DotSettings'

'area:build':
- '**/*.cake'
- 'build/**/*'

'area:repo':
- '.github/*.yml'
- '.github/**/*.md'
- CODEOWNERS
- '.github/CODEOWNERS'

'area:ci':
- '.github/workflows/**/*'
- 'lgtm.yml'

'area:deps':
- '**/Directory.Packages.props'
- Directory.Build.props
- Directory.Build.targets
- global.json
- .config/dotnet-tools.json

'area:docs':
- 'docs/**/*'
- '.all-contributorsrc'
- '**/CHANGELOG.md'
- '**/LICENSE'
- '**/NuGet-README.md'
- '**/README.md'
- '**/THIRD-PARTY-NOTICES'
17 changes: 17 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Breaking changes
labels:
- breaking
- title: New features
labels:
- enhancement
- title: Bugs fixed
labels:
- bug
- title: Other changes
labels:
- "*"
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
branches: [ main ]
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ main ]

env:
RELEASING: ${{ startsWith(github.ref, 'refs/tags/') }}
DOCKERHUB_REPO: tenacom/buildvana-builder
TEST_TAG: ${{ env.DOCKERHUB_REPO }}:test

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate Docker mrepository metadata
id: meta
if: ${{ env.RELEASING }}
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKERHUB_REPO }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and load into Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}
- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }}
- name: Build and push
if: ${{ env.RELEASING }}
uses: docker/build-push-action@v5
with:
context: .
push: ${{ env.RELEASING }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
19 changes: 19 additions & 0 deletions .github/workflows/label-pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Set labels on PR
on:
pull_request_target:
types: [ opened, synchronize, reopened ]

jobs:

set_labels:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Assign labels to pull request
uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
87 changes: 87 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# ============================================================================
# This image provides what's needed to build .NET projects with Buildvana SDK
# in GitLab CI, including Windows setup program generation via InnoSetup:
#
# - .NET SDK
# - Wine (to run command-line InnoSetup)
# - XVFB (for running Wine without a display)
# - GitLab's release-cli
#
# TODO: Try to make the image smaller (not trivial: Wine requires X11
# or Wayland, even for running conaole programs!)
# Things we may try:
# - Switch from Ubuntu to Alpine Linux (X11?? Wine??)
# - Remove some unused packages (which ones?)
# - Take inspiration from other projects, namely:
# * https://github.com/suchja/x11client
# * https://github.com/amake/wine
# * https://github.com/amake/innosetup-docker
# (.NET SDK will have to be added via Dockerfile, though)
# ============================================================================

# ----------------------------------------------------------------------------
# BASE IMAGE / INITIAL SETUP
# ----------------------------------------------------------------------------

# Use the official .NET SDK image as a parent image
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy

# Set the working directory
WORKDIR /app

# ----------------------------------------------------------------------------
# DEPENDENCY SETUP / SYSTEM CONFIGURATION
# ----------------------------------------------------------------------------

USER root

# Install dependencies:
# - Git and SSH are needed to work with Git repositories
# - Wine is needed to run Inno Setup when requested by projects
# - i386 architecture is needed because we need to run Inno Setup under 32-bit Wine
# - osslsigncode is needed to sign setup executables (work in progress, not verified)
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
openssh-client \
osslsigncode

# Install Wine from WineHQ
# https://wiki.winehq.org/Ubuntu
# xvfb is needed to run wine (which is an X11 client, even when running console apps) without a display
RUN dpkg --add-architecture i386 \
&& mkdir -pm755 /etc/apt/keyrings \
&& wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key \
&& wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources \
&& apt-get update \
&& apt-get install -y --install-recommends winehq-stable xvfb

# Get rid of APT package lists
RUN rm -rf /var/lib/apt/lists/*

# Download and install GitLab's release-cli
RUN curl --location --output /usr/local/bin/release-cli "https://gitlab.com/api/v4/projects/gitlab-org%2Frelease-cli/packages/generic/release-cli/latest/release-cli-linux-amd64" \
&& chmod +x /usr/local/bin/release-cli

# Copy utility scripts and add them to PATH
COPY opt /opt/
ENV PATH $PATH:/opt/bin

# ----------------------------------------------------------------------------
# USER-LEVEL CONFIGURATION
# ----------------------------------------------------------------------------

USER app

# We want to use 32-bit Wine for InnoSetup
ENV WINEARCH win32

# Only show error messages from Wine
ENV WINEDEBUG -all,err+all

# Suppress prompts to install wine-gecko and wine-mono
ENV WINEDLLOVERRIDES mscoree,mshtml=

# Create Wine prefix and configure registry values
COPY --chown=app --chmod=755 configure-wine /tmp/
RUN x11-headless wine-session /tmp/configure-wine \
&& rm /tmp/configure-wine
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Tenacom and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Questo progetto contiene i componenti che implementano i workflow CI/CD per i progetti .NET.

L'obiettivo è raggiungere, utilizzando il server GitLab di Isango, lo stesso grado di automazione di cui i progetti Tenacom usufruiscono su GitHub.

## Nota sul versioning

Questo progetto è conforme alla specifica [Semantic Versioning 2.0.0](https://semver.org).

La versione di questo progetto segue, per quanto riguarda _major version_ e _minor version_, quella dell'SDK .NET utilizzato; ad esempio, le versioni 8.0.x utilizzeranno .NET SDK 8.0.
Empty file added SampleProject/.buildvana-home
Empty file.
24 changes: 24 additions & 0 deletions SampleProject/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "4.0.0",
"commands": [
"dotnet-cake"
]
},
"nbgv": {
"version": "3.6.133",
"commands": [
"nbgv"
]
},
"dotnet-reportgenerator-globaltool": {
"version": "5.2.4",
"commands": [
"reportgenerator"
]
}
}
}
Loading

0 comments on commit 4a22289

Please sign in to comment.