Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevContainer and automatic versioning #158

Merged
merged 37 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2a95a44
add initial files
0x7878 Nov 29, 2023
9d39882
Fix typo in Dockerfile
0x7878 Feb 20, 2024
63d1e04
Merge remote-tracking branch 'origin/main' into feature-devcontainer
0x7878 Feb 20, 2024
ea46f75
Merge remote-tracking branch 'origin/main' into feature-devcontainer
0x7878 Feb 22, 2024
1e49a07
Add GitVersion
0x7878 Feb 22, 2024
5d3bfa1
Add version file
0x7878 Feb 22, 2024
4313979
Update Dockerfile to optimize image layers and install GitVersion.Tool
0x7878 Feb 22, 2024
c03e89f
Add GitVersion.yml configuration file
0x7878 Feb 22, 2024
620aca7
Add codeql workflow and dependencies
0x7878 Feb 22, 2024
31ca677
Fix GitVersion
0x7878 Feb 22, 2024
36a6962
change to mainline
0x7878 Feb 23, 2024
2a7982e
Merge pull request #1 from 0x7878/feature-devcontainer
0x7878 Apr 3, 2024
2c77271
Cleanup codeql
0x7878 Apr 3, 2024
4ad7669
Add new workflow
0x7878 Apr 3, 2024
64ecdba
Update version.yml
0x7878 Apr 3, 2024
3cf29ae
rebase
0x7878 Apr 3, 2024
dbd5824
Update version
actions-user Apr 4, 2024
0c5d275
Update version
actions-user Apr 9, 2024
85a2786
remove act binary
0x7878 Apr 16, 2024
70b2b6d
Merge branch 'main' of https://github.com/0x7878/dbus-opendtu
0x7878 Apr 16, 2024
f763474
Update version
actions-user Apr 16, 2024
659b605
Update version
actions-user Apr 16, 2024
7b9d83a
Remove empty line in README.md
0x7878 Apr 17, 2024
fd0a1b8
Merge branch 'main' of https://github.com/0x7878/dbus-opendtu
0x7878 Apr 17, 2024
dd7364b
Update version
actions-user Apr 17, 2024
e1e007e
update
0x7878 Apr 17, 2024
147fe8e
Merge branch 'main' of https://github.com/0x7878/dbus-opendtu
0x7878 Apr 17, 2024
5ec44c6
Update version
actions-user Apr 17, 2024
5bc2227
add tags
0x7878 Apr 17, 2024
804fb0f
Merge branch 'main' of https://github.com/0x7878/dbus-opendtu
0x7878 Apr 17, 2024
a06ade0
Update version
actions-user Apr 17, 2024
a9f7c0e
Update version
actions-user Apr 17, 2024
80a2812
comment out tags
0x7878 Apr 17, 2024
54f717c
Merge branch 'main' of https://github.com/0x7878/dbus-opendtu
0x7878 Apr 17, 2024
eafede7
Update version
actions-user Apr 17, 2024
5ff3273
Update version
actions-user Apr 17, 2024
0fd7d63
Update version
actions-user Apr 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:3
RUN pip install requests

# Switch to the vscode user
USER vscode

WORKDIR /home/vscode

# Update and install dependencies in a single RUN command to reduce image layers
RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
chmod +x ./dotnet-install.sh && \
./dotnet-install.sh --version latest && \
rm dotnet-install.sh

# Install GitVersion
RUN /home/vscode/.dotnet/dotnet tool install --global GitVersion.Tool --version 5.* && \
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc && \
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc
13 changes: 13 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "Python Dev Container",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"docker-in-docker": {
"version": "latest",
"moby": true,
"dockerDashComposeVersion": "v1"
}
}
}
68 changes: 16 additions & 52 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: '19 16 * * 2'
- cron: "19 16 * * 2"

jobs:
analyze:
Expand All @@ -32,45 +20,21 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
language: ["python"]

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
51 changes: 51 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Update Version"

on:
push:
# tags:
# - v*
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
workflow_dispatch:
jobs:
versioning:
name: Versioning
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup .net core
uses: actions/setup-dotnet@v1
with:
dotnet-version: "8.0.x"

- name: install gitversion
uses: gittools/actions/gitversion/setup@v0
with:
versionspec: "5.x"

- name: Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0

- name: Create version file
run: |
echo "Version: ${{ steps.gitversion.outputs.majorMinorPatch }}" > version.txt

- name: Commit and push
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add version.txt
git commit -m "Update version"
git push
5 changes: 5 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mode: Mainline
branches: {}
ignore:
sha: []
merge-message-formats: {}
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# dbus-opendtu

> **Attention:**
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Version: 1.1.20