Skip to content

Commit c2a7b6f

Browse files
Initial commit
0 parents  commit c2a7b6f

14 files changed

Lines changed: 870 additions & 0 deletions

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @albertospelta
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: 🐛 Bug Report
2+
labels: ["bug", "untriaged"]
3+
description: Report unexpected behavior or errors.
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Before opening a bug report, please search for the behavior in the existing issues.
9+
10+
---
11+
- type: textarea
12+
id: describe-problem
13+
attributes:
14+
label: Describe the problem
15+
description:
16+
Describe the issue you are experiencing. Provide a clear and concise description of what you were trying to do and what happened, including any error messages you encountered.
17+
validations:
18+
required: true
19+
- type: input
20+
id: library-version
21+
attributes:
22+
label: Library version
23+
description:
24+
Specify the version of the library you are using.
25+
validations:
26+
required: true
27+
- type: input
28+
id: powerbi-version
29+
attributes:
30+
label: Power BI version
31+
description:
32+
Specify the version of Power BI Desktop or Service you are using.
33+
- type: textarea
34+
id: steps-to-reproduce
35+
attributes:
36+
label: Steps to reproduce
37+
description: List the steps to reproduce the issue.
38+
placeholder: |
39+
1. Go to '...'
40+
2. Click on '...'
41+
3. ...
42+
4. See the error
43+
- type: textarea
44+
id: additional-context
45+
attributes:
46+
label: Additional context
47+
description:
48+
Add any other relevant context about the issue here.
49+
- type: textarea
50+
id: screenshots
51+
attributes:
52+
label: Screenshots
53+
description: Add screenshots to help explain your problem, if applicable.
54+

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
#contact_links:
3+
# - name: 💬 General Questions
4+
# url: https://github.com/daxlib/#PACKAGE_REPO_NAME#/discussions
5+
# about: Please ask and answer questions as a discussion thread
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 💡 Feature Request
2+
labels: ["enhancement", "untriaged"]
3+
description: Suggest an idea or improvement
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for submitting a feature request!
9+
10+
---
11+
- type: textarea
12+
id: the-feature-request
13+
attributes:
14+
label: Feature Request
15+
description:
16+
Write a clear and concise description of the feature or problem you would like to see addressed.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: proposed-solution
21+
attributes:
22+
label: Proposed Solution
23+
description: Describe your proposed solution and its benefits for the project and its users.
24+
validations:
25+
required: true
26+
- type: textarea
27+
id: additional-context
28+
attributes:
29+
label: Additional Context
30+
description:
31+
Please include any other relevant context, such as screenshots or mockups, if applicable.

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Pull Request
2+
3+
## Description
4+
5+
<!-- Briefly describe your changes -->
6+
7+
## Related Issue
8+
9+
<!-- If applicable, reference the issue number -->
10+
11+
## Checklist
12+
13+
- [ ] The code has been tested and works as expected in Power BI
14+
- [ ] Documentation has been updated (if needed)
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# GitHub Actions workflow for publishing DaxLib packages
2+
#
3+
# This workflow automates the publication of a new package version to the daxlib/daxlib repository.
4+
# Maintainers can trigger it manually via the "Run workflow" button in the Actions tab.
5+
#
6+
# Steps:
7+
# - Extracts the package name and version from the manifest file
8+
# - Creates or updates a release branch in the upstream repository
9+
# - Copies the package files to the appropriate folder structure
10+
# - Commits and pushes the changes
11+
# - Creates a pull request for new releases
12+
13+
name: publish-package-pr
14+
15+
on:
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
publish:
23+
runs-on: ubuntu-latest
24+
steps:
25+
# Checkout the current repository
26+
- name: Checkout source
27+
uses: actions/checkout@v4
28+
with:
29+
repository: ${{ github.repository }}
30+
path: source-repo
31+
32+
# Generate the app token
33+
- name: Generate app token
34+
id: bot_auth
35+
uses: actions/create-github-app-token@v2
36+
with:
37+
app-id: ${{ vars.DAXLIBDEVBOT_APPID }}
38+
private-key: ${{ secrets.DAXLIBDEVBOT_APPKEY }}
39+
owner: daxlib
40+
repositories: daxlib
41+
42+
# Checkout the upstream repository daxlib/daxlib
43+
- name: Checkout upstream
44+
uses: actions/checkout@v4
45+
with:
46+
repository: daxlib/daxlib
47+
path: upstream-repo
48+
token: ${{ steps.bot_auth.outputs.token }}
49+
50+
# Configure Git
51+
- name: Git config
52+
working-directory: upstream-repo
53+
run: |
54+
git config user.name "${{ github.actor }}"
55+
git config user.email "${{ github.actor }}@users.noreply.github.com"
56+
57+
# Read the package version from the manifest
58+
- name: Read package manifest
59+
id: package
60+
working-directory: source-repo
61+
run: |
62+
PACKAGE_NAME=$(jq -r '.id' src/manifest.daxlib)
63+
echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
64+
echo "Package name: ${PACKAGE_NAME}"
65+
PACKAGE_VERSION=$(jq -r '.version' src/manifest.daxlib)
66+
echo "version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
67+
echo "Package version: ${PACKAGE_VERSION}"
68+
PACKAGE_FOLDER="packages/$(echo "${PACKAGE_NAME}" | cut -c1 | tr '[:upper:]' '[:lower:]')/$(echo "${PACKAGE_NAME}" | tr '[:upper:]' '[:lower:]')/${PACKAGE_VERSION}"
69+
echo "folder=${PACKAGE_FOLDER}" >> $GITHUB_OUTPUT
70+
echo "Package folder: ${PACKAGE_FOLDER}"
71+
72+
# Checkout the branch (or create it if it doesn't exist)
73+
- name: Checkout branch
74+
id: branch
75+
working-directory: upstream-repo
76+
run: |
77+
BRANCH_NAME="${{ github.event.repository.name }}/publish-${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}"
78+
echo "name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
79+
echo "Branch name: ${BRANCH_NAME}"
80+
git fetch origin
81+
if git show-ref --verify --quiet "refs/remotes/origin/${BRANCH_NAME}"; then
82+
echo "action=Update" >> $GITHUB_OUTPUT
83+
git checkout "${BRANCH_NAME}"
84+
else
85+
echo "action=Add" >> $GITHUB_OUTPUT
86+
git checkout -b "${BRANCH_NAME}"
87+
fi
88+
89+
# Create the package folder if it doesn't exist
90+
- name: Create package folder
91+
working-directory: upstream-repo
92+
run: mkdir -p "${{ steps.package.outputs.folder }}"
93+
94+
# Copy package files to the new folder
95+
- name: Copy package files
96+
run: cp -rv source-repo/src/* "upstream-repo/${{ steps.package.outputs.folder }}/"
97+
98+
# Commit changes
99+
- name: Git commit changes
100+
working-directory: upstream-repo
101+
run: git add -A && git commit -m "${{ steps.branch.outputs.action }} package ${{ steps.package.outputs.name }} version ${{ steps.package.outputs.version }}"
102+
103+
# Push to upstream
104+
- name: Git push upstream
105+
working-directory: upstream-repo
106+
run: git push origin "${{ steps.branch.outputs.name }}"
107+
108+
# Create the pull request (if the branch was created)
109+
- name: Create pull request
110+
if: steps.branch.outputs.action == 'Add'
111+
working-directory: upstream-repo
112+
env:
113+
GH_TOKEN: ${{ steps.bot_auth.outputs.token }}
114+
run: |
115+
gh pr create \
116+
--title "Add package \`${{ steps.package.outputs.name }}\` version ${{ steps.package.outputs.version }}" \
117+
--body "Automated package publication from ${{ github.repository }}" \
118+
--base main \
119+
--head "${{ steps.branch.outputs.name }}"

0 commit comments

Comments
 (0)