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

[Release] Merge v0.1.0 stable release branch to main branch #24

Merged
merged 27 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8729df3
ci: use custom issue labels for dependabot PRs
NayanTheSpaceGuy Sep 18, 2024
c4f84a4
Bump actions/github-script from 6 to 7
dependabot[bot] Sep 16, 2024
b448cc7
ensure PRs to main are only from allowed branches
NayanTheSpaceGuy Sep 18, 2024
6aac783
added manual trigger for testing
NayanTheSpaceGuy Sep 18, 2024
5aed7cd
Update issue templates
NayanTheSpaceGuy Sep 18, 2024
17a3b30
added code of conduct
NayanTheSpaceGuy Sep 18, 2024
947399a
added PR template
NayanTheSpaceGuy Sep 18, 2024
f3c123d
added SECURITY.md
NayanTheSpaceGuy Sep 19, 2024
b5307c0
added AUTHORS.md
NayanTheSpaceGuy Sep 19, 2024
ff20085
added LEGAL.md
NayanTheSpaceGuy Sep 19, 2024
801a7d5
added build instructions and links to imp docs
NayanTheSpaceGuy Sep 19, 2024
2927d22
changed release strategy to rely on tags instead of Cargo.toml
NayanTheSpaceGuy Sep 19, 2024
fd7d0a5
updated version value to reflect correct version
NayanTheSpaceGuy Sep 19, 2024
6c89a5a
moved scripts to dotlab repo
NayanTheSpaceGuy Sep 20, 2024
8fda9ec
correct version reflected in compile
NayanTheSpaceGuy Sep 20, 2024
00ff329
Refactor to clone dotlab repo into config directory instead of bundli…
NayanTheSpaceGuy Sep 20, 2024
a08958f
fix: handle logic when dot dir is non-empty
NayanTheSpaceGuy Sep 20, 2024
a4bcbb6
refactored code to remove code duplication
NayanTheSpaceGuy Sep 20, 2024
fae52ea
prerelease: bump version to v0.1.0-rc1
NayanTheSpaceGuy Sep 20, 2024
f29f525
release: bump version to v0.1.0 stable
NayanTheSpaceGuy Sep 20, 2024
fb5805b
fix: windows imports errors
NayanTheSpaceGuy Sep 20, 2024
20b69ec
reverted version back to beta since builds failed
NayanTheSpaceGuy Sep 20, 2024
604b837
fix: all windows incompatible funcs now exclude windows builds
NayanTheSpaceGuy Sep 20, 2024
d85cfe8
fix: windows unused imports and Result type errors
NayanTheSpaceGuy Sep 21, 2024
d5a9359
fix: added forgotten import for windows
NayanTheSpaceGuy Sep 21, 2024
a454830
prerelease: bump version to v0.1.0-rc1
NayanTheSpaceGuy Sep 21, 2024
51eb46d
release: bump version to v0.1.0 stable
NayanTheSpaceGuy Sep 21, 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
128 changes: 128 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
nayantsg@proton.me.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: B - unconfirmed bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

### Checklist
- [ ] I checked for duplicate issues.
- [ ] I checked already existing discussions.
- [ ] This issue is present on both stable and development branches.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: E - feature request
assignees: ''

---

### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

### Describe the solution you'd like
A clear and concise description of what you want to happen.

### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

### Additional context
Add any other context or screenshots about the feature request here.

### Checklist
- [ ] I checked for duplicate issues.
- [ ] I checked already existing discussions.
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
### Type of Change
- [ ] New feature
- [ ] Bug fix
- [ ] Documentation update
- [ ] Code quality improvement
- [ ] CI improvement
- [ ] Build improvement
- [ ] Maintenance
- [ ] Other
**Specify other**:

### Add compact, short information about your PR for easier understanding:

- Goal of the PR
- How does the PR work?
- Does it resolve any reported issue?
- If not a bug fix, why is this PR needed? What usecases does it solve?

### How to test
<!-- Example code or instructions -->

### Issues / other PRs related
<!--[What issue/discussion is related to this PR (if any)]-->
- Resolves #

### Additional Information
<!--[Any additional information that reviewers should be aware of.]-->

### Checklist
- [ ] I have performed a self-review of my own code.
- [ ] I have commented my code wherever necessary, particularly in hard-to-understand areas.
- [ ] My changes generate no errors/warnings/merge conflicts.
14 changes: 14 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions

It is recommended to use the stable version, as it is thoroughly tested and widely used. The `develop` branch contains bleeding-edge commits that are not fully tested and should not be used in production environments.

| Version | Supported |
| ------- | ------------------ |
| latest | :white_check_mark: |
| develop | :x: |

## Reporting a Vulnerability

To report a bug, it is recommended to create an issue. If you prefer to report the bug privately, you can email me at [nayantsg@proton.me](mailto:nayantsg@proton.me).
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ updates:
directory: "/"
schedule:
interval: "weekly"
labels:
- "A - rust"
- "A - dependencies"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "A - ci / github-actions"
- "A - dependencies"
18 changes: 18 additions & 0 deletions .github/workflows/branch-protection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Branch Protection to Main'

on:
workflow_dispatch:
pull_request:
branches:
- main

jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Ensure PRs are only from allowed branches
run: |
if ! [[ ${GITHUB_HEAD_REF} =~ ^(release/|hotfix/).+ ]]; then
echo "Error: Pull requests to main can only be from 'release/*' or 'hotfix/*' branches."
exit 1
fi
61 changes: 6 additions & 55 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: Build & Release

on:
workflow_dispatch:
pull_request:
branches: ["main", "develop"]
paths:
- 'Cargo.toml'
push:
tags:
- 'v*.*.*'

permissions:
contents: write
Expand Down Expand Up @@ -86,54 +85,30 @@ jobs:
name: Release
runs-on: ubuntu-24.04
needs: build
if: github.ref == 'refs/heads/main'
if: startsWith(github.ref_name, 'v') && !contains(github.ref_name, '-')
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Check if release should be created
shell: bash
run: |
set -o pipefail

RELEASE_VERSION=v$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml)
OLD_VERSION=$( curl -s --fail-with-body https://api.github.com/repos/NayanTheSpaceGuy/necronux/releases | jq -r '.[0].tag_name' )

echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "$OLD_VERSION -> $RELEASE_VERSION"

if [[ "$RELEASE_VERSION" == "$OLD_VERSION" ]] || \
! [[ "$OLD_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]] || \
! [[ "$RELEASE_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "SHOULD_RELEASE=no" >> $GITHUB_ENV
else
git tag "$RELEASE_VERSION"
git push -u origin "$RELEASE_VERSION"
echo "SHOULD_RELEASE=yes" >> $GITHUB_ENV
fi

- name: Download binaries
uses: actions/download-artifact@v4
if: env.SHOULD_RELEASE == 'yes'
with:
path: .
merge-multiple: true

- name: Extract binaries
if: env.SHOULD_RELEASE == 'yes'
shell: bash
run: |
mkdir -p bin
for tar_file in built-binaries-*.tar.gz; do
echo "Extracting $tar_file"
tar -xzvf $tar_file -C bin
done

- name: Publish release
uses: softprops/action-gh-release@v2
if: env.SHOULD_RELEASE == 'yes'
with:
files: bin/*
tag_name: ${{ env.RELEASE_VERSION }}
Expand All @@ -146,43 +121,20 @@ jobs:
name: Pre-Release
runs-on: ubuntu-24.04
needs: build
if: github.ref == 'refs/heads/develop'
if: startsWith(github.ref_name, 'v') && contains(github.ref_name, '-')
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Check if pre-release should be created
shell: bash
run: |
set -o pipefail

PRE_RELEASE_VERSION=v$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml)
OLD_VERSION=$( curl -s --fail-with-body https://api.github.com/repos/NayanTheSpaceGuy/necronux/releases | jq -r '.[0].tag_name' )

echo "PRE_RELEASE_VERSION=$PRE_RELEASE_VERSION" >> $GITHUB_ENV
echo "$OLD_VERSION -> $PRE_RELEASE_VERSION"

if [[ "$PRE_RELEASE_VERSION" == "$OLD_VERSION" ]] || \
! [[ "$OLD_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]] || \
! [[ "$PRE_RELEASE_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)$ ]]; then
echo "SHOULD_PRE_RELEASE=no" >> $GITHUB_ENV
else
git tag "$PRE_RELEASE_VERSION"
git push -u origin "$PRE_RELEASE_VERSION"
echo "SHOULD_PRE_RELEASE=yes" >> $GITHUB_ENV
fi

- name: Download binaries
uses: actions/download-artifact@v4
if: env.SHOULD_PRE_RELEASE == 'yes'
with:
path: .
merge-multiple: true

- name: Extract binaries
if: env.SHOULD_PRE_RELEASE == 'yes'
shell: bash
run: |
mkdir -p bin
Expand All @@ -193,7 +145,6 @@ jobs:

- name: Publish pre-release
uses: softprops/action-gh-release@v2
if: env.SHOULD_PRE_RELEASE == 'yes'
with:
files: bin/*
tag_name: ${{ env.PRE_RELEASE_VERSION }}
Expand Down
Loading
Loading