Skip to content

Commit

Permalink
GitHub Actions: use Go 1.20 and new versions of GH Actions steps (#277)
Browse files Browse the repository at this point in the history
* update to newer GitHub Actions actions

* build with Go 1.20

* specify Go version differently

* use ubuntu-latest for all Linux stesp
  • Loading branch information
drewda authored Jul 28, 2023
1 parent d2157e2 commit 8a49e89
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-latest, macos-latest]
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v1
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: '^1.20'
id: go
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Run tests
run: go test -coverprofile c.out ./...
- name: Produce coverage report
Expand All @@ -32,19 +32,19 @@ jobs:
build-linux:
if: ${{ github.event_name == 'release' }}
needs: test
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go 1.18
uses: actions/setup-go@v1
uses: actions/checkout@v3
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: '^1.20'
- name: Build on Linux
working-directory: ${{ github.workspace }}/cmd/transitland
run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build
- name: Store Linux binary
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: transitland-linux
path: ${{ github.workspace }}/cmd/transitland/transitland
Expand All @@ -54,11 +54,11 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go 1.18
uses: actions/setup-go@v1
uses: actions/checkout@v3
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: '^1.20'
- name: Build on macOS
working-directory: ${{ github.workspace }}/cmd/transitland
run: CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build
Expand All @@ -78,17 +78,17 @@ jobs:
run: |
gon -log-level=debug -log-json ./.github/gonconfig.json
- name: Store macOS binary
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: transitland-macos
path: ${{ github.workspace }}/transitland.zip
release:
if: ${{ github.event_name == 'release' }}
needs: [build-linux, build-macos]
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Download Linux binary
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: transitland-linux
- name: Attach Linux binary to GitHub release
Expand All @@ -102,7 +102,7 @@ jobs:
asset_label: Linux AMD-64 binary
asset_content_type: application/binary
- name: Download macOS binary
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: transitland-macos
- name: Attach macOS binary to GitHub release
Expand All @@ -120,10 +120,10 @@ jobs:
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.x'
node-version: '16.x'
- run: npm install github-release-notes -g
- run: gren release --override
env:
Expand Down

0 comments on commit 8a49e89

Please sign in to comment.