Skip to content

Commit

Permalink
Update mods action
Browse files Browse the repository at this point in the history
  • Loading branch information
ttomsu committed Mar 14, 2024
1 parent 43025ff commit 6750dd7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.21'

- name: Build All Packages
run: go build -v ./...
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/update-mods.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

name: Go

on:
workflow_dispatch:
schedule:
- cron: '50 12 1 * *'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Update modules
run: |
go get -u ./...
go mod tidy
- name: Build All Packages
run: go build -v ./...

- name: Test
run: go test -v ./...

- name: Build Linux binary
run: go build -o gphotobackup-linux-$GITHUB_RUN_ID gphotobackup.go

- name: Save Binary
uses: actions/upload-artifact@v4
with:
name: gphotobackup-linux
path: gphotobackup-linux*

- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Update modules"
reviewers: ttomsu
commit-message: "Update go modules"
delete-branch: true

- name: Auto-merge
run: gh pr merge --rebase "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6750dd7

Please sign in to comment.