Skip to content

Commit a92ac73

Browse files
Update project README.md and .github .vscode contents (#2)
* Add .vscode folder and settings * Update .github content * Update README.md
1 parent efffc2f commit a92ac73

7 files changed

Lines changed: 141 additions & 84 deletions

File tree

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: 💬 General Questions
4-
url: https://github.com/sql-bi/dev-daxlib-sample/discussions
4+
url: https://github.com/daxlib/dev-daxlib-sample/discussions
55
about: Please ask and answer questions as a discussion thread

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ body:
1313
attributes:
1414
label: Feature Request
1515
description:
16-
Write a clear and concise description of the feature or problem you would like to see addressed in dev-daxlib-sample.
16+
Write a clear and concise description of the feature or problem you would like to see addressed.
1717
validations:
1818
required: true
1919
- type: textarea
2020
id: proposed-solution
2121
attributes:
2222
label: Proposed Solution
23-
description: Describe your proposed solution and how it will benefit dev-daxlib-sample and its users.
23+
description: Describe your proposed solution and its benefits for the project and its users.
2424
validations:
2525
required: true
2626
- type: textarea

.github/workflows/publish-daxlib-sample.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.
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 }}"

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"analysis-services.tmdl",
4+
"davidanson.vscode-markdownlint"
5+
]
6+
}

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.insertSpaces": true,
3+
"editor.tabSize": 4,
4+
"editor.detectIndentation": false,
5+
"files.associations": {
6+
"*.daxlib": "json"
7+
}
8+
}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@ This repository is where we:
1313
- Review and merge contributions
1414

1515
> [!IMPORTANT]
16-
> Please do not submit issues or contributions directly to sql-bi/daxlib. All development activity should occur in this repository.
16+
> Please do not submit issues or contributions directly to [daxlib](https://github.com/daxlib/daxlib) GitHub repository. All development activity should take place in this repository.
1717
1818
## Release Process
1919

2020
New versions follow this workflow:
2121

2222
- Development happens in this repository
23-
- Releases are submitted via Pull Requests to [sql-bi/daxlib](https://github.com/sql-bi/daxlib)
23+
- Releases are submitted via Pull Requests to the [daxlib](https://github.com/daxlib/daxlib) repository on GitHub
2424
- Once the Pull Request is approved and merged, the release becomes available on [daxlib.org](https://daxlib.org/)
2525

2626
## How to Contribute
2727

28-
- Fork this repository: [https://github.com/sql-bi/dev-daxlib-sample/fork](https://github.com/sql-bi/dev-daxlib-sample/fork)
28+
- Fork this repository: [https://github.com/daxlib/dev-daxlib-sample/fork](https://github.com/daxlib/dev-daxlib-sample/fork)
2929
- Create a feature branch for your changes
3030
- Submit a Pull Request with a clear description of your changes
3131

3232
## How to report Issues
3333

34-
- Open an issue or bug using GitHub Issues: https://github.com/sql-bi/dev-daxlib-sample/issues/new
34+
- Open an issue or bug using GitHub Issues: https://github.com/daxlib/dev-daxlib-sample/issues/new
3535

3636
## How to stay updated on new releases
3737

3838
To receive notifications for every new release, you can use the GitHub **Subscribe** feature:
3939

40-
1. Go to the main page of the repository: [https://github.com/sql-bi/dev-daxlib-sample](https://github.com/sql-bi/dev-daxlib-sample)
40+
1. Go to the main page of the repository: [https://github.com/daxlib/dev-daxlib-sample](https://github.com/daxlib/dev-daxlib-sample)
4141
2. In the top right, click the **Notifications** bell icon and select **Watching**
4242
3. This way, you can configure your notification for new releases and other activities

0 commit comments

Comments
 (0)