-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (66 loc) · 2.63 KB
/
update-mod-monthly.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# =============================================================================
# Weekly Module Update
# =============================================================================
# This workflow runs monthly to:
# 1. Update the `go.mod` and `go.sum` files if all the tests succeeds to run
# in all Go versions with that updated versions. (Go v1.15~latest)
# 2. Test `go get -u` and `go install` functionality of the latest release.
# 3. Pull request the updated `go.mod` and `go.sum`
#
# NOTE:
# You need to set the "PERSONAL_ACCESS_TOKEN" env variable in the repository
# secreat of your repo at:
# [Settings]-[Secrets]-[Actions secrets]
# To generate a new token go to:
# https://github.com/settings/tokens
# * You need add the "repo" scope to the token but no more.
# =============================================================================
name: Monthly Update
on:
workflow_dispatch:
schedule:
# Runs At 19:00 UTC (AM 04:00 JST) on day-of-month 1
- cron: "0 19 1 * *"
jobs:
automated_build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check current install functionality
run: |
set -eu
: # Check go install functionality
docker-compose --file ./.github/docker-compose.yml run gogetu
docker-compose --file ./.github/docker-compose.yml run goinstall
: # Check brew functionality
docker-compose --file ./.github/docker-compose.yml run linuxbrew
- name: Update go.mod and run tests
run: |
set -eu
: # Update go.mod and go.sum
docker-compose --file ./.github/docker-compose.yml run tidy
: # Check module version compatibility
docker-compose --file ./.github/docker-compose.yml run v1_15
docker-compose --file ./.github/docker-compose.yml run v1_16
docker-compose --file ./.github/docker-compose.yml run v1_17
docker-compose --file ./.github/docker-compose.yml run latest
- name: Create Pull Request on Change
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Bump-up patch version
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: kyoh86/git-vertag-action@v1
id: vertag
with:
method: patch
- name: Push tag
if: steps.cpr.outputs.pull-request-operation == 'created'
run: |
echo 'Bump-up to:' ${{ steps.vertag.outputs.vertag }}
git push --tags