Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test workflow release #30

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [ '*' ]
pull_request:
types: [ opened, edited, reopened, synchronize, review_requested ]
branches: [ '*' ]
workflow_call:

Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,35 @@ jobs:
tag-prefix: ${{ env.TAG_PREFIX }}
tag-only: true

# Release:
# runs-on: ubuntu-latest
# if: |
# github.event.workflow_run.event == 'pull_request' &&
# github.event.workflow_run.conclusion == 'success' &&
# github.event.pull_request.merged == true
# needs: [ 'ReleaseDryRun' ]
# permissions:
# contents: write # to be able to publish a GitHub release
# outputs:
# RESULT: ${{ needs.ReleaseDryRun.outputs.RESULT }}
# VERSION: ${{ needs.ReleaseDryRun.outputs.VERSION }}
# RELEASE_NOTES: ${{ needs.ReleaseDryRun.outputs.RELEASE_NOTES }}
# steps:
# - name: Update module meta
# run: |
# RESULT='${{ needs.ReleaseDryRun.outputs.RESULT }}'
# VERSION='${{ needs.ReleaseDryRun.outputs.VERSION }}'
# RELEASE_NOTES='${{ needs.ReleaseDryRun.outputs.RELEASE_NOTES }}'
#
# echo "🕘 Updating module meta..."
# echo " - RESULT: ${RESULT}"
# echo " - VERSION: ${VERSION}"
# echo " - RELEASE_NOTES: ${RELEASE_NOTES}"
# if [ "${RESULT}" == "SUCCESS" ]; then
# echo "✅ Done."
# else
# echo "❎ SKIPPED."
# fi
Release:
runs-on: ubuntu-latest
if: |
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.pull_request.merged == true
needs: [ 'ReleaseDryRun' ]
permissions:
contents: write # to be able to publish a GitHub release
outputs:
RESULT: ${{ needs.ReleaseDryRun.outputs.RESULT }}
VERSION: ${{ needs.ReleaseDryRun.outputs.VERSION }}
RELEASE_NOTES: ${{ needs.ReleaseDryRun.outputs.RELEASE_NOTES }}
steps:
- name: Update module meta
run: |
RESULT='${{ needs.ReleaseDryRun.outputs.RESULT }}'
VERSION='${{ needs.ReleaseDryRun.outputs.VERSION }}'
RELEASE_NOTES='${{ needs.ReleaseDryRun.outputs.RELEASE_NOTES }}'

echo "🕘 Updating module meta..."
echo " - RESULT: ${RESULT}"
echo " - VERSION: ${VERSION}"
echo " - RELEASE_NOTES: ${RELEASE_NOTES}"
if [ "${RESULT}" == "SUCCESS" ]; then
echo "✅ Done."
else
echo "❎ SKIPPED."
fi

# if [ "${RESULT}" == "SUCCESS" ]; then
# DATE=`date +%Y-%m-%d`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Template to quickly spin up a Go module project.

**Workflow**

Workflow implemented by this template is as follows:
Workflow implemented by this template is as the following:

- Dependencies are checked and updated weekly by `dependabot.yaml`, and then PRs are automatically merged to `main` branch by `automerge-dependabot.yaml`.
- `ci.yaml` is triggered on every push to any branch to run tests and generate code coverage report.
Expand Down
4 changes: 2 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# go-module-template release notes

## 2023-08-xx - v0.1.0
## 2023-11-25 - v0.1.0

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