17 Commits

Author SHA1 Message Date
GitHub Actions
be3cb4b259 Foo 2021-12-10 18:02:09 +00:00
Stephan
788aa0d4b5 meh 2021-12-10 19:01:50 +01:00
Stephan
490cc0c703 muh 2021-12-10 18:58:57 +01:00
Stephan
cfd959c2e0 pii 2021-12-10 18:56:29 +01:00
Stephan
43287ec9cf exp 2021-12-10 18:56:12 +01:00
Stephan
4bc423721a exp 2021-12-10 18:09:50 +01:00
Stephan
5ef1917f61 exp 2021-12-10 18:04:43 +01:00
Stephan
3b98325435 exp 2021-12-10 17:53:40 +01:00
Stephan
7688e0cbc7 exp 2021-12-10 17:48:01 +01:00
Stephan
5595250e09 exp 2021-12-10 17:42:04 +01:00
Stephan
4e8f7f271f exp 2021-12-10 17:39:59 +01:00
Stephan
f2db146379 exp 2021-12-10 17:35:15 +01:00
Stephan
11e6e12f60 exp 2021-12-10 17:32:45 +01:00
Stephan
56827f467a rename 2021-12-10 17:30:51 +01:00
Stephan
34a05d36a6 exp 2021-12-10 17:29:04 +01:00
Stephan
bb1ee93cb9 exp 2021-12-10 17:27:14 +01:00
Stephan
de64657f2c exp 2021-12-10 16:40:40 +01:00
4 changed files with 83 additions and 19 deletions

View File

@@ -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
View 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
})

View File

@@ -1 +1,2 @@
foo
foo

1
pii.txt Normal file
View File

@@ -0,0 +1 @@
pii