Skip to content

Commit cf8e81b

Browse files
authored
Merge pull request #30 from btnguyen2k/dev
Test workflow release
2 parents b477dd3 + d539892 commit cf8e81b

File tree

4 files changed

+33
-32
lines changed

4 files changed

+33
-32
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: [ '*' ]
66
pull_request:
7+
types: [ opened, edited, reopened, synchronize, review_requested ]
78
branches: [ '*' ]
89
workflow_call:
910

.github/workflows/release.yaml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,35 @@ jobs:
4343
tag-prefix: ${{ env.TAG_PREFIX }}
4444
tag-only: true
4545

46-
# Release:
47-
# runs-on: ubuntu-latest
48-
# if: |
49-
# github.event.workflow_run.event == 'pull_request' &&
50-
# github.event.workflow_run.conclusion == 'success' &&
51-
# github.event.pull_request.merged == true
52-
# needs: [ 'ReleaseDryRun' ]
53-
# permissions:
54-
# contents: write # to be able to publish a GitHub release
55-
# outputs:
56-
# RESULT: ${{ needs.ReleaseDryRun.outputs.RESULT }}
57-
# VERSION: ${{ needs.ReleaseDryRun.outputs.VERSION }}
58-
# RELEASE_NOTES: ${{ needs.ReleaseDryRun.outputs.RELEASE_NOTES }}
59-
# steps:
60-
# - name: Update module meta
61-
# run: |
62-
# RESULT='${{ needs.ReleaseDryRun.outputs.RESULT }}'
63-
# VERSION='${{ needs.ReleaseDryRun.outputs.VERSION }}'
64-
# RELEASE_NOTES='${{ needs.ReleaseDryRun.outputs.RELEASE_NOTES }}'
65-
#
66-
# echo "🕘 Updating module meta..."
67-
# echo " - RESULT: ${RESULT}"
68-
# echo " - VERSION: ${VERSION}"
69-
# echo " - RELEASE_NOTES: ${RELEASE_NOTES}"
70-
# if [ "${RESULT}" == "SUCCESS" ]; then
71-
# echo "✅ Done."
72-
# else
73-
# echo "❎ SKIPPED."
74-
# fi
46+
Release:
47+
runs-on: ubuntu-latest
48+
if: |
49+
github.event.workflow_run.event == 'pull_request' &&
50+
github.event.workflow_run.conclusion == 'success' &&
51+
github.event.pull_request.merged == true
52+
needs: [ 'ReleaseDryRun' ]
53+
permissions:
54+
contents: write # to be able to publish a GitHub release
55+
outputs:
56+
RESULT: ${{ needs.ReleaseDryRun.outputs.RESULT }}
57+
VERSION: ${{ needs.ReleaseDryRun.outputs.VERSION }}
58+
RELEASE_NOTES: ${{ needs.ReleaseDryRun.outputs.RELEASE_NOTES }}
59+
steps:
60+
- name: Update module meta
61+
run: |
62+
RESULT='${{ needs.ReleaseDryRun.outputs.RESULT }}'
63+
VERSION='${{ needs.ReleaseDryRun.outputs.VERSION }}'
64+
RELEASE_NOTES='${{ needs.ReleaseDryRun.outputs.RELEASE_NOTES }}'
65+
66+
echo "🕘 Updating module meta..."
67+
echo " - RESULT: ${RESULT}"
68+
echo " - VERSION: ${VERSION}"
69+
echo " - RELEASE_NOTES: ${RELEASE_NOTES}"
70+
if [ "${RESULT}" == "SUCCESS" ]; then
71+
echo "✅ Done."
72+
else
73+
echo "❎ SKIPPED."
74+
fi
7575
7676
# if [ "${RESULT}" == "SUCCESS" ]; then
7777
# DATE=`date +%Y-%m-%d`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Template to quickly spin up a Go module project.
1717

1818
**Workflow**
1919

20-
Workflow implemented by this template is as follows:
20+
Workflow implemented by this template is as the following:
2121

2222
- Dependencies are checked and updated weekly by `dependabot.yaml`, and then PRs are automatically merged to `main` branch by `automerge-dependabot.yaml`.
2323
- `ci.yaml` is triggered on every push to any branch to run tests and generate code coverage report.

RELEASE-NOTES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# go-module-template release notes
22

3-
## 2023-08-xx - v0.1.0
3+
## 2023-11-25 - v0.1.0
44

55
Template for Go module projects:
66
- Dependencies version updates with dependabot.
77
- GitHub Actions for auto-merging PRs created by dependabot.
8-
- GitHub Actions for CI/CD.
8+
- GitHub Actions for CI/CD and auto-releasing.

0 commit comments

Comments
 (0)