Compare commits
17 Commits
release/7.
...
release/4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be3cb4b259 | ||
|
|
788aa0d4b5 | ||
|
|
490cc0c703 | ||
|
|
cfd959c2e0 | ||
|
|
43287ec9cf | ||
|
|
4bc423721a | ||
|
|
5ef1917f61 | ||
|
|
3b98325435 | ||
|
|
7688e0cbc7 | ||
|
|
5595250e09 | ||
|
|
4e8f7f271f | ||
|
|
f2db146379 | ||
|
|
11e6e12f60 | ||
|
|
56827f467a | ||
|
|
34a05d36a6 | ||
|
|
bb1ee93cb9 | ||
|
|
de64657f2c |
19
.github/workflows/manual-thingy.yml
vendored
19
.github/workflows/manual-thingy.yml
vendored
@@ -1,19 +0,0 @@
|
||||
name: Manually Do Something
|
||||
on: workflow_dispatch
|
||||
jobs:
|
||||
job:
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/heads/release/')
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Do Something
|
||||
run: |
|
||||
version="${${{ github.ref }}:19}" # trim starting 'refs/heads/release/' (19 chars)
|
||||
echo "Tag ref ${{ github.ref }} as v$version"
|
||||
git tag v$version
|
||||
git config user.email "github-actions@zpqrtbnk.net"
|
||||
git config user.name "GitHub Actions (Do Something)"
|
||||
git push --tags
|
||||
81
.github/workflows/publish-release.yml
vendored
Normal file
81
.github/workflows/publish-release.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
name: Publish Release
|
||||
on: workflow_dispatch
|
||||
jobs:
|
||||
job:
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/heads/release/')
|
||||
steps:
|
||||
- name: Validate the release
|
||||
uses: actions/github-script@v4
|
||||
with:
|
||||
script: |
|
||||
const ver = "${{ github.ref }}".substring(19)
|
||||
const tag = "v" + ver
|
||||
var rel
|
||||
try {
|
||||
rel = await github.repos.getReleaseByTag({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag: tag
|
||||
})
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(`Could not find a release for tag ${tag}.`)
|
||||
return
|
||||
}
|
||||
if (!rel.draft) {
|
||||
core.setFailed(`Release for tag ${tag} is already published.`)
|
||||
return
|
||||
}
|
||||
try {
|
||||
const ref = await github.git.getRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'tags/' + tag
|
||||
})
|
||||
core.setFailed(`Tag ${tag} already exists.`)
|
||||
return
|
||||
}
|
||||
catch (error) {
|
||||
// this is expected
|
||||
}
|
||||
// everything is OK
|
||||
|
||||
- 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: Finalize the release
|
||||
run: |
|
||||
ref="${{ github.ref }}"
|
||||
branch="${ref:11}" # trim starting 'refs/heads/' (11 chars)
|
||||
version="${ref:19}" # trim starting 'refs/heads/release/' (19 chars)
|
||||
echo "Tag branch $branch as v$version"
|
||||
git tag v$version
|
||||
git push --tags
|
||||
#git push :$branch
|
||||
|
||||
- name: Publish the release
|
||||
uses: actions/github-script@v4
|
||||
with:
|
||||
script: |
|
||||
const ver = "${{ github.ref }}".substring(19)
|
||||
const tag = "v" + ver
|
||||
const rel = await github.repos.getReleaseByTag({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag: tag
|
||||
})
|
||||
await github.repos.updateRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: rel.id,
|
||||
draft: false
|
||||
})
|
||||
Reference in New Issue
Block a user