Compare commits
18 Commits
release/7.
...
v7.7.13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c49c48572f | ||
|
|
f7c5b3e956 | ||
|
|
4dc95bf252 | ||
|
|
dc7dd1e768 | ||
|
|
8add493c77 | ||
|
|
30bcef5c7f | ||
|
|
f9a41a087c | ||
|
|
35131167a6 | ||
|
|
d215b853f8 | ||
|
|
84a970f8a4 | ||
|
|
31cbe74bb2 | ||
|
|
108af45b25 | ||
|
|
100a1b61f4 | ||
|
|
d44e0c8512 | ||
|
|
8f36bf3ee6 | ||
|
|
890c988757 | ||
|
|
bedc122eda | ||
|
|
e87cd570d2 |
40
.github/workflows/hz.js
vendored
Normal file
40
.github/workflows/hz.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
// see https://github.com/actions/github-script
|
||||||
|
// , core, glob, io, exec, require
|
||||||
|
module.exports = function (github, context) {
|
||||||
|
|
||||||
|
var module = {}
|
||||||
|
|
||||||
|
// this is *not* exported
|
||||||
|
function noop ( ) { }
|
||||||
|
|
||||||
|
// this *is* exported
|
||||||
|
module.getReleaseByTag = async function (tag_name) {
|
||||||
|
var rel = null
|
||||||
|
try {
|
||||||
|
// this does *not* return draft releases, so we have to list them
|
||||||
|
//rel = await github.repos.getReleaseByTag({ ... })
|
||||||
|
const rels = await github.repos.listReleases({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo
|
||||||
|
})
|
||||||
|
for (const r of rels.data) {
|
||||||
|
if (r.tag_name === tag_name) {
|
||||||
|
rel = r
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
return rel
|
||||||
|
}
|
||||||
|
|
||||||
|
module.getRefReleaseTag = function (ref) {
|
||||||
|
// test, must start with 'refs/heads/release/' 19 chars
|
||||||
|
return "v" + ref.substring(19)
|
||||||
|
}
|
||||||
|
|
||||||
|
return module;
|
||||||
|
}
|
||||||
79
.github/workflows/publish-release.yml
vendored
79
.github/workflows/publish-release.yml
vendored
@@ -1,11 +1,33 @@
|
|||||||
name: Publish Release
|
name: Publish
|
||||||
on: workflow_dispatch
|
|
||||||
|
#meh
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
confirm:
|
||||||
|
description: "This is really going to release. Enter \'yolo\' to confirm that you really want to do it."
|
||||||
|
required: true
|
||||||
|
default: ""
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job:
|
job:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: startsWith(github.ref, 'refs/heads/release/')
|
if: startsWith(github.ref, 'refs/heads/release/')
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Confirm
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
if ("${{ github.event.inputs.confirm }}" != "yolo") {
|
||||||
|
core.setFailed(`Not confirmed (confirm = '${{ github.event.inputs.confirm }}').`)
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Validate the release
|
- name: Validate the release
|
||||||
uses: actions/github-script@v4
|
uses: actions/github-script@v4
|
||||||
with:
|
with:
|
||||||
@@ -13,27 +35,14 @@ jobs:
|
|||||||
# token needed to see draft releases when getting all releases
|
# token needed to see draft releases when getting all releases
|
||||||
github-token: ${{ secrets.MY_GITHUB_TOKEN_TESTREPO }}
|
github-token: ${{ secrets.MY_GITHUB_TOKEN_TESTREPO }}
|
||||||
script: |
|
script: |
|
||||||
const ver = "${{ github.ref }}".substring(19)
|
const hz = require("./.github/workflows/hz.js")(github, context)
|
||||||
const tag = "v" + ver
|
const ref = "${{ github.ref }}"
|
||||||
var rel = null
|
const tag = hz.getRefReleaseTag(ref)
|
||||||
try {
|
if (tag === null) {
|
||||||
// this does *not* return draft releases, so we have to list them
|
core.setFailed(`Invalid reference ${ref} is not release/<version>.`)
|
||||||
//rel = await github.repos.getReleaseByTag({ ... })
|
|
||||||
const rels = await github.repos.listReleases({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo
|
|
||||||
})
|
|
||||||
for (const r of rels.data) {
|
|
||||||
if (r.tag_name === tag) {
|
|
||||||
rel = r
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
core.setFailed(`Could not find a release for tag ${tag}.`)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
var rel = await hz.getReleaseByTag(tag)
|
||||||
if (rel === null) {
|
if (rel === null) {
|
||||||
core.setFailed(`Could not find a release for tag ${tag}.`)
|
core.setFailed(`Could not find a release for tag ${tag}.`)
|
||||||
return
|
return
|
||||||
@@ -56,11 +65,6 @@ jobs:
|
|||||||
}
|
}
|
||||||
// everything is OK
|
// everything is OK
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Configure repository
|
- name: Configure repository
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -81,21 +85,14 @@ jobs:
|
|||||||
uses: actions/github-script@v4
|
uses: actions/github-script@v4
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const ver = "${{ github.ref }}".substring(19)
|
const hz = require("./.github/workflows/hz.js")(github, context)
|
||||||
const tag = "v" + ver
|
const ref = "${{ github.ref }}"
|
||||||
var rel = null
|
const tag = hz.getRefReleaseTag(ref)
|
||||||
// no, see above
|
if (tag === null) {
|
||||||
//const rel = await github.repos.getReleaseByTag({ ... })
|
core.setFailed(`Invalid reference ${ref} is not release/<version>.`)
|
||||||
const rels = await github.repos.listReleases({
|
return
|
||||||
owner: context.repo.owner,
|
}
|
||||||
repo: context.repo.repo
|
var rel = await hz.getReleaseByTag(tag)
|
||||||
})
|
|
||||||
for (const r of rels.data) {
|
|
||||||
if (r.tag_name === tag) {
|
|
||||||
rel = r
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await github.repos.updateRelease({
|
await github.repos.updateRelease({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
|
|||||||
Reference in New Issue
Block a user