Compare commits
44 Commits
dependabot
...
master
Author | SHA1 | Date | |
---|---|---|---|
1946eeb4dd | |||
08b11b83d0 | |||
cc58d51434 | |||
22cd3b3c1a | |||
e0c7e2a725 | |||
|
7bc1195651 | ||
|
786c441206 | ||
|
558f12143c | ||
|
2cd8137eeb | ||
|
77f77c3e8b | ||
|
143637c4fc | ||
|
06bdaca2c1 | ||
|
10c0963c6d | ||
|
30c00bf385 | ||
|
d6b1a8d591 | ||
|
c090c23662 | ||
|
d8cd3257e0 | ||
|
93e9740904 | ||
|
95d31440db | ||
|
f916de4ff4 | ||
|
b3615798ac | ||
|
4f5e3068cc | ||
|
86dab14dfd | ||
|
fa0c7b9ac1 | ||
|
863aefcc9d | ||
|
d6ed51a6f0 | ||
|
efed3f3cc1 | ||
|
13a337a9b8 | ||
|
ac561c87a4 | ||
|
6f924bbb78 | ||
|
cb40378ce6 | ||
|
74f650bb33 | ||
|
b893475bf9 | ||
|
cfa76a1ae7 | ||
|
716be074d3 | ||
|
2249395b68 | ||
|
b7b967f078 | ||
|
df19db009c | ||
|
b789a373ac | ||
|
80ea5c8f2c | ||
|
aee24c13f3 | ||
|
d77c4fdfd4 | ||
|
21b99568fe | ||
|
0835da33bd |
64
.github/actions/test-action/package-lock.json
generated
vendored
64
.github/actions/test-action/package-lock.json
generated
vendored
|
@ -156,22 +156,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
|
@ -182,11 +171,6 @@
|
|||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||
},
|
||||
"node_modules/tunnel": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
|
@ -200,20 +184,6 @@
|
|||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
|
@ -356,12 +326,9 @@
|
|||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
|
@ -371,11 +338,6 @@
|
|||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||
},
|
||||
"tunnel": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
|
@ -386,20 +348,6 @@
|
|||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
|
|
18
.github/workflows/assign-milestones.js
vendored
18
.github/workflows/assign-milestones.js
vendored
|
@ -1,14 +1,10 @@
|
|||
// get the project
|
||||
// check if the name matches a version x.y or x.y.z
|
||||
// created
|
||||
// check that there is a corresponding milestone
|
||||
// else create that milestone
|
||||
// and assign the issue to the milestone
|
||||
// deleted
|
||||
// get the issue
|
||||
// if issue is not closed,
|
||||
// remove issue from milestone, if any
|
||||
|
||||
// assign a milestone to issues or PRs added to a project, with a name corresponding
|
||||
// to the name of the project - create the milestone if it does not exist
|
||||
//
|
||||
// adding a *second* project to the issue will update the milestone accordingly
|
||||
// removing that project will reset the milestone entirely (not use the other project)
|
||||
// and, no idea what happens if one very quickly adds and removes an issue
|
||||
//
|
||||
// an issue or PR actually becomes a card (or, a card is actually created...) when
|
||||
// it's move to a project column for the first time - being assigned to the project
|
||||
// and showing in project's backlog is not enough.
|
||||
|
|
128
.github/workflows/publish-release.js
vendored
128
.github/workflows/publish-release.js
vendored
|
@ -1,6 +1,7 @@
|
|||
module.exports = async ({github, context, core}) => {
|
||||
module.exports = /*async*/ ({github, context, core}) => {
|
||||
|
||||
const restapi = github.rest
|
||||
var dryrun = context.payload.inputs.dryrun
|
||||
|
||||
function firstOrDefault(items, predicate) {
|
||||
for (const item of items) {
|
||||
|
@ -10,6 +11,127 @@ module.exports = async ({github, context, core}) => {
|
|||
}
|
||||
return null
|
||||
}
|
||||
|
||||
console.log("script")
|
||||
|
||||
async function validateRelease() {
|
||||
|
||||
const version = context.payload.inputs.version
|
||||
const tag = "v" + version
|
||||
console.log(`Validate version '${version}'.`)
|
||||
|
||||
// git branch must exist
|
||||
const branchRefs = await restapi.git.listMatchingRefs({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: `heads/release/${version}`
|
||||
})
|
||||
if (firstOrDefault(branchRefs.data, (x) => x.ref == `refs/heads/release/${version}`) == null) {
|
||||
core.setFailed(`Could not find branch 'release/${version}'.`)
|
||||
return
|
||||
}
|
||||
console.log(`Found branch 'release/${version}'.`)
|
||||
|
||||
// github milestone must exist and be open
|
||||
const milestone = await getMilestone()
|
||||
if (milestone == null) {
|
||||
core.setFailed(`Could not find milestone '${version}'.`)
|
||||
return
|
||||
}
|
||||
if (milestone.state != "open") {
|
||||
core.setFailed(`Milestone '${version}' is already closed.`)
|
||||
return
|
||||
}
|
||||
console.log(`Found open milestone '${version}'.`)
|
||||
|
||||
// github release must exist and not be published yet
|
||||
const release = await getRelease()
|
||||
if (release === null) {
|
||||
core.setFailed(`Could not find a GitHub release for tag '${tag}'.`)
|
||||
return
|
||||
}
|
||||
if (!release.draft) {
|
||||
core.setFailed(`GitHub release for tag '${tag}' is already published.`)
|
||||
return
|
||||
}
|
||||
console.log(`Found yet-unpublished GitHub release for tag '${tag}'.`)
|
||||
|
||||
// tag must not exist
|
||||
const tagRefs = await restapi.git.listMatchingRefs({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: `tags/${tag}`
|
||||
})
|
||||
if (firstOrDefault(tagRefs.data, (x) => x.ref == `tags/${tag}`) != null) {
|
||||
core.setFailed(`Tag '${tag}' already exists.`)
|
||||
return
|
||||
}
|
||||
console.log(`Verified that tag '${tag}' does not exist yet.`)
|
||||
|
||||
console.log('Release is valid.')
|
||||
}
|
||||
|
||||
async function publishRelease() {
|
||||
|
||||
const version = context.payload.inputs.version
|
||||
const tag = "v" + version
|
||||
console.log(`Publish GitHub release '${version}'.`)
|
||||
|
||||
const release = await getRelease()
|
||||
|
||||
await restapi.repos.updateRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: release.id,
|
||||
draft: false
|
||||
})
|
||||
}
|
||||
|
||||
async function closeMilestone() {
|
||||
|
||||
const version = context.payload.inputs.version
|
||||
const tag = "v" + version
|
||||
console.log(`Close milestone '${version}'.`)
|
||||
|
||||
const milestone = await getMilestone()
|
||||
await restapi.issues.updateMilestone({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
milestone_number: milestone.number,
|
||||
state: "closed"
|
||||
})
|
||||
}
|
||||
|
||||
async function getRelease() {
|
||||
|
||||
// note: getReleaseByTag only returns published releases
|
||||
|
||||
// note: we may eventually need to paginate
|
||||
// and then releases.headers should contain what we need?
|
||||
// https://octokit.github.io/rest.js/v18#pagination
|
||||
|
||||
const version = context.payload.inputs.version
|
||||
const tag = `v${version}`
|
||||
const releases = await restapi.repos.listReleases({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
})
|
||||
const release = firstOrDefault(releases.data, (x) => x.tag_name == tag)
|
||||
return release
|
||||
}
|
||||
|
||||
async function getMilestone() {
|
||||
|
||||
const version = context.payload.inputs.version
|
||||
const milestonesResponse = await restapi.issues.listMilestones({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
})
|
||||
const milestones = milestonesResponse.data
|
||||
return firstOrDefault(milestones, (x) => x.title == version)
|
||||
}
|
||||
|
||||
return {
|
||||
validateRelease: validateRelease,
|
||||
publishRelease: publishRelease,
|
||||
closeMilestone: closeMilestone
|
||||
}
|
||||
}
|
40
.github/workflows/publish-release.yml
vendored
40
.github/workflows/publish-release.yml
vendored
|
@ -1,14 +1,46 @@
|
|||
name: Publish Release
|
||||
on: workflow_dispatch
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version'
|
||||
required: true
|
||||
dryrun:
|
||||
description: 'DryRun'
|
||||
required: true
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
job:
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/heads/release/') # 19 leading chars
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Configure repository
|
||||
shell: bash
|
||||
run: |
|
||||
git config user.email "github-actions@hazelcast.com"
|
||||
git config user.name "GitHub Actions (Build Release)"
|
||||
|
||||
- name: Validate the release
|
||||
uses: actions/github-script@v5
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/workflows/publish-release.js')
|
||||
console.log(script)
|
||||
const scriptf = require('./.github/workflows/publish-release.js')
|
||||
const script = scriptf({github, context, core})
|
||||
await script.validateRelease()
|
||||
|
||||
- name: Finalize GitHub release and milestone
|
||||
if: ${{ github.event.inputs.dryrun == 'false' }}
|
||||
uses: actions/github-script@v5
|
||||
with:
|
||||
script: |
|
||||
const scriptf = require('./.github/workflows/publish-release.js')
|
||||
const script = scriptf({github, context, core})
|
||||
await script.publishRelease()
|
||||
await script.closeMilestone()
|
||||
|
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "test-repo-base"]
|
||||
path = test-repo-base
|
||||
url = https://git.sw3.cz/kamikaze/test-repo-base.git
|
|
@ -19,7 +19,7 @@ Clone the repository with: `git clone https://github.com/zpqrtbnk/test-repo.git
|
|||
We have test GitHUb pages (from the `gh-pages` branch) at: http://zpqrtbnk.github.io/test-repo/
|
||||
|
||||
We have an image in the README (markdown)
|
||||
![Image](https://raw.github.com/zpqrtbnk/test-repo/master/wtf.jpg)
|
||||
![Image](wtf.jpg)
|
||||
|
||||
We have an image in the README (html)
|
||||
<img src="./wtf.jpg" />
|
||||
|
|
1
test-repo-base
Submodule
1
test-repo-base
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 3de11d7640ed17f93ce38d31c9dea0fd65774077
|
Loading…
Reference in New Issue
Block a user