Skip to content

Commit 8fcea0e

Browse files
holzenspThe Pkl Team (automation)
authored and
The Pkl Team (automation)
committed
Initial commit
0 parents  commit 8fcea0e

File tree

134 files changed

+13775
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+13775
-0
lines changed

.circleci/config.pkl

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
//===----------------------------------------------------------------------===//
2+
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// https://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//===----------------------------------------------------------------------===//
16+
amends ".../pkl-project-commons/packages/pkl.impl.circleci/PklCI.pkl"
17+
18+
triggerPackageDocsBuild = "main"
19+
20+
jobs {
21+
["build"] {
22+
docker {
23+
new { image = "cimg/openjdk:17.0" }
24+
}
25+
steps {
26+
"checkout"
27+
new RunStep {
28+
name = "Build"
29+
command = "./gradlew build"
30+
environment {}
31+
}
32+
new StoreTestResults { path = "build/test-results" }
33+
new PersistToWorkspaceStep {
34+
root = "."
35+
paths {
36+
"build"
37+
}
38+
}
39+
}
40+
}
41+
["release"] {
42+
docker {
43+
new { image = "maniator/gh:v2.40.1" }
44+
}
45+
steps {
46+
"checkout" // for `git tag` querying
47+
new AttachWorkspaceStep { at = "." }
48+
new RunStep {
49+
name = "Publish release on GitHub"
50+
// language=bash
51+
command = #"""
52+
if [[ -d build/releases && -n "$(ls -A build/releases)" ]]
53+
then
54+
REPO="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
55+
for dir in build/releases/*
56+
do
57+
if [[ -d "$dir" ]]
58+
then
59+
pkg=$(basename "$dir")
60+
if gh release view "$pkg" ; then
61+
echo "Package $pkg already published"
62+
else
63+
# TODO we can be kinder to GitHub by querying once for all releases.
64+
echo -n "> Releasing $pkg at SHA1 ${CIRCLE_SHA1}..."
65+
gh release create "$pkg" \
66+
--title "$pkg" \
67+
--target "${CIRCLE_SHA1}" \
68+
--repo "$REPO" \
69+
--notes "Release of $pkg" \
70+
"$dir"/*
71+
echo "DONE"
72+
fi
73+
else
74+
echo "> SKIPPING $dir; not a directory"
75+
fi
76+
done
77+
else
78+
echo "No new packages to release."
79+
fi
80+
"""#
81+
}
82+
}
83+
}
84+
}
85+
86+
prb {
87+
jobs {
88+
"build"
89+
}
90+
}
91+
92+
main {
93+
jobs {
94+
"build"
95+
new {
96+
["release"] {
97+
requires {
98+
"build"
99+
}
100+
context = "pkl-github-release"
101+
}
102+
}
103+
}
104+
}

.circleci/config.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Generated from CircleCI.pkl. DO NOT EDIT.
2+
version: '2.1'
3+
orbs:
4+
pr-approval: apple/pr-approval@0.1.0
5+
jobs:
6+
build:
7+
steps:
8+
- checkout
9+
- run:
10+
command: ./gradlew build
11+
name: Build
12+
environment: {}
13+
- store_test_results:
14+
path: build/test-results
15+
- persist_to_workspace:
16+
root: '.'
17+
paths:
18+
- build
19+
docker:
20+
- image: cimg/openjdk:17.0
21+
release:
22+
steps:
23+
- checkout
24+
- attach_workspace:
25+
at: '.'
26+
- run:
27+
command: |-
28+
if [[ -d build/releases && -n "$(ls -A build/releases)" ]]
29+
then
30+
REPO="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
31+
for dir in build/releases/*
32+
do
33+
if [[ -d "$dir" ]]
34+
then
35+
pkg=$(basename "$dir")
36+
if gh release view "$pkg" ; then
37+
echo "Package $pkg already published"
38+
else
39+
# TODO we can be kinder to GitHub by querying once for all releases.
40+
echo -n "> Releasing $pkg at SHA1 ${CIRCLE_SHA1}..."
41+
gh release create "$pkg" \
42+
--title "$pkg" \
43+
--target "${CIRCLE_SHA1}" \
44+
--repo "$REPO" \
45+
--notes "Release of $pkg" \
46+
"$dir"/*
47+
echo "DONE"
48+
fi
49+
else
50+
echo "> SKIPPING $dir; not a directory"
51+
fi
52+
done
53+
else
54+
echo "No new packages to release."
55+
fi
56+
name: Publish release on GitHub
57+
docker:
58+
- image: maniator/gh:v2.40.1
59+
trigger-package-docs-build:
60+
steps:
61+
- run:
62+
command: |-
63+
curl --location \
64+
--request POST \
65+
--header "Content-Type: application/json" \
66+
-u "${CIRCLE_TOKEN}:" \
67+
--data '{ "branch": "main" }' \
68+
"https://circleci.com/api/v2/project/github/apple/pkl-package-docs/pipeline"
69+
name: Triggering docsite build
70+
docker:
71+
- image: cimg/base:current
72+
workflows:
73+
prb:
74+
jobs:
75+
- hold:
76+
type: approval
77+
- pr-approval/authenticate:
78+
context: pkl-pr-approval
79+
- build:
80+
requires:
81+
- hold
82+
- pr-approval/authenticate
83+
when:
84+
matches:
85+
value: << pipeline.git.branch >>
86+
pattern: ^pull/\d+(/head)?$
87+
main:
88+
jobs:
89+
- build
90+
- release:
91+
requires:
92+
- build
93+
context: pkl-github-release
94+
- trigger-package-docs-build:
95+
requires:
96+
- release
97+
context:
98+
- pkl-pr-approval
99+
when:
100+
equal:
101+
- main
102+
- << pipeline.git.branch >>

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.idea/
2+
3+
# Ignore Gradle project-specific cache directory
4+
.gradle
5+
6+
# Ignore Gradle build output directory
7+
build
8+
9+
.DS_Store
10+
11+
.out/

CODE_OF_CONDUCT.adoc

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
== Code of Conduct
2+
3+
=== Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our
7+
project and our community a harassment-free experience for everyone,
8+
regardless of age, body size, disability, ethnicity, sex
9+
characteristics, gender identity and expression, level of experience,
10+
education, socio-economic status, nationality, personal appearance,
11+
race, religion, or sexual identity and orientation.
12+
13+
=== Our Standards
14+
15+
Examples of behavior that contributes to creating a positive environment
16+
include:
17+
18+
* Using welcoming and inclusive language
19+
* Being respectful of differing viewpoints and experiences
20+
* Gracefully accepting constructive criticism
21+
* Focusing on what is best for the community
22+
* Showing empathy towards other community members
23+
24+
Examples of unacceptable behavior by participants include:
25+
26+
* The use of sexualized language or imagery and unwelcome sexual
27+
attention or advances
28+
* Trolling, insulting/derogatory comments, and personal or political
29+
attacks
30+
* Public or private harassment
31+
* Publishing others’ private information, such as a physical or
32+
electronic address, without explicit permission
33+
* Other conduct which could reasonably be considered inappropriate in a
34+
professional setting
35+
36+
=== Our Responsibilities
37+
38+
Project maintainers are responsible for clarifying the standards of
39+
acceptable behavior and are expected to take appropriate and fair
40+
corrective action in response to any instances of unacceptable behavior.
41+
42+
Project maintainers have the right and responsibility to remove, edit,
43+
or reject comments, commits, code, wiki edits, issues, and other
44+
contributions that are not aligned to this Code of Conduct, or to ban
45+
temporarily or permanently any contributor for other behaviors that they
46+
deem inappropriate, threatening, offensive, or harmful.
47+
48+
=== Scope
49+
50+
This Code of Conduct applies within all project spaces, and it also
51+
applies when an individual is representing the project or its community
52+
in public spaces. Examples of representing a project or community
53+
include using an official project e-mail address, posting via an
54+
official social media account, or acting as an appointed representative
55+
at an online or offline event. Representation of a project may be
56+
further defined and clarified by project maintainers.
57+
58+
=== Enforcement
59+
60+
Instances of abusive, harassing, or otherwise unacceptable behavior may
61+
be reported by contacting the open source team at
62+
opensource-conduct@group.apple.com. All complaints will be reviewed and
63+
investigated and will result in a response that is deemed necessary and
64+
appropriate to the circumstances. The project team is obligated to
65+
maintain confidentiality with regard to the reporter of an incident.
66+
Further details of specific enforcement policies may be posted
67+
separately.
68+
69+
Project maintainers who do not follow or enforce the Code of Conduct in
70+
good faith may face temporary or permanent repercussions as determined
71+
by other members of the project’s leadership.
72+
73+
=== Attribution
74+
75+
This Code of Conduct is adapted from the
76+
https://www.contributor-covenant.org[Contributor Covenant], version 1.4,
77+
available at
78+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

CONTRIBUTING.adoc

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
:uri-github-issue-pkl: https://github.com/apple/pkl-pantry/issues/new
2+
:uri-seven-rules: https://cbea.ms/git-commit/#seven-rules
3+
4+
= Pkl Pantry Contributors Guide
5+
6+
Welcome to the Pkl community, and thank you for contributing!
7+
This guide explains how to get involved.
8+
9+
* <<Licensing>>
10+
* <<Issue Tracking>>
11+
* <<Pull Requests>>
12+
13+
== Licensing
14+
15+
Pkl Pantry is released under the Apache 2.0 license.
16+
This is why we require that, by submitting a pull request, you acknowledge that you have the right to license your contribution to Apple and the community, and agree that your contribution is licensed under the Apache 2.0 license.
17+
18+
== Issue Tracking
19+
20+
To file a bug or feature request, use {uri-github-issue-pkl}[GitHub].
21+
Be sure to include the following information:
22+
23+
* Context
24+
** What are/were you trying to achieve?
25+
** What's the impact of this bug/feature?
26+
27+
For bug reports, additionally include the following information:
28+
29+
* The output of `pkl --version`.
30+
* The complete error message.
31+
* The simplest possible steps to reproduce.
32+
* Output produced from the template.
33+
* Error messages from the target system.
34+
35+
== Pull Requests
36+
37+
When preparing a pull request, follow this checklist:
38+
39+
* Imitate the conventions of surrounding code.
40+
* Format the files in your PR with the JetBrains IDE formatter.
41+
* Follow the {uri-seven-rules}[seven rules] of great Git commit messages:
42+
** Separate subject from body with a blank line.
43+
** Limit the subject line to 50 characters.
44+
** Capitalize the subject line.
45+
** Do not end the subject line with a period.
46+
** Use the imperative mood in the subject line.
47+
** Wrap the body at 72 characters.
48+
** Use the body to explain what and why vs. how.
49+
50+
== Maintainers
51+
52+
The project’s maintainers (those with write access to the upstream repository) are listed in link:MAINTAINERS.adoc[].

0 commit comments

Comments
 (0)