Skip to content

Commit

Permalink
Add SHA256 checksums to release artifacts (#1226)
Browse files Browse the repository at this point in the history
* [actions] use go-release-action for releases and add sha256 checksums

* [actions] yamllint fixes and consistency updates
  • Loading branch information
sikha-root committed Jun 12, 2024
1 parent 4f0ae71 commit d38a43b
Show file tree
Hide file tree
Showing 20 changed files with 148 additions and 112 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/backend_build_prod_ecr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
name: Backend Build&Push to Prod ECR
on:

"on":
push:
branches: [ 'develop' ]
branches: ['develop']

permissions:
id-token: write
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/backend_docker_release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
name: Backend Publish docker image

on:
"on":
release:
types: ['released']
types:
- 'released'

env:
REGISTRY: ghcr.io
Expand Down
49 changes: 25 additions & 24 deletions .github/workflows/backend_release.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
---
name: Backend release
on:

"on":
release:
types: [released]
types:
- 'released'

jobs:
binary:
strategy:
matrix:
arch: [arm, arm64, amd64, 386]
arch: [arm, arm64, amd64, "386"]
os: [linux, darwin, freebsd, windows]
exclude:
- os: darwin
arch: arm
- os: darwin
arch: 386
arch: "386"

runs-on: ubuntu-latest
steps:
- name: Download Go
uses: actions/setup-go@v5
with:
go-version: 1.21.1
id: go

steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Build
run: |
echo "Tag that is going to be used as digger version: ${{ github.event.release.tag_name }}"
env GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} CGO_ENABLED=0 go build -ldflags="-X digger/pkg/utils.version=${{ github.event.release.tag_name }}" -o digger-api ./backend
- name: Publish linux-x64 exec to github
id: upload-release-asset-linux-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: 'digger-api'
asset_name: digger-api-${{matrix.os}}-${{matrix.arch}}
asset_content_type: application/octet-stream

- name: Build and publish binary artifact to GitHub
id: build-and-release-binary
uses: wangyoucao577/go-release-action@8fa1e8368c8465264d64e0198208e10f71474c87 # v1.50
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.os }}
goarch: ${{ matrix.arch }}
goversion: 1.21.1
project_path: ./backend
binary_name: digger-api
pre_command: export CGO_ENABLED=0
ldflags: ${{ matrix.ldflags }}
sha256sum: true
md5sum: false
asset_name: "digger-api-${{matrix.os}}-${{matrix.arch}}"
compress_assets: "OFF"
12 changes: 5 additions & 7 deletions .github/workflows/backend_test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
name: Backend Go Tests
on:

"on":
push:
branches: [ develop ]
branches: ['develop']
pull_request:

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

steps:
- name: Download Go
uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -38,6 +39,3 @@ jobs:
env:
GITHUB_PAT_TOKEN: ${{ secrets.TOKEN_GITHUB }}
working-directory: backend



12 changes: 9 additions & 3 deletions .github/workflows/cli_release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
name: release cli
on:

"on":
release:
branches:
- 'go'
types: [released]
types:
- 'released'

jobs:
binary:
runs-on: ubuntu-latest

steps:
- name: Download Go
uses: actions/setup-go@v5
Expand All @@ -16,6 +21,7 @@ jobs:

- name: Check out repository
uses: actions/checkout@v4

- name: Build
run: |
echo "Tag that is going to be used as digger version: ${{ github.event.release.tag_name }}"
Expand All @@ -30,4 +36,4 @@ jobs:
upload_url: ${{ github.event.release.upload_url }}
asset_path: 'digger'
asset_name: digger-cli-Linux-X64
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
46 changes: 23 additions & 23 deletions .github/workflows/cli_release_multiarch.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
---
name: release cli multi architecture
on:

"on":
release:
branches:
- 'go'
types: [released]
types:
- 'released'

jobs:
binary:
strategy:
matrix:
arch: [arm, arm64, amd64, 386]
arch: [arm, arm64, amd64, "386"]
os: [linux, darwin, freebsd, windows]
exclude:
- os: darwin
arch: arm
- os: darwin
arch: 386
arch: "386"

runs-on: ubuntu-latest

steps:
- name: Download Go
uses: actions/setup-go@v5
with:
go-version: 1.21.1
id: go

- name: Check out repository
uses: actions/checkout@v4
- name: Build
run: |
echo "Tag that is going to be used as digger version: ${{ github.event.release.tag_name }}"
env GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} CGO_ENABLED=0 go build -ldflags="-X digger/pkg/utils.version=${{ github.event.release.tag_name }}" -o digger ./cli/cmd/digger

- name: Publish linux-x64 exec to github
id: upload-release-asset-linux-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish binary artifact to GitHub
id: build-and-release-binary
uses: wangyoucao577/go-release-action@8fa1e8368c8465264d64e0198208e10f71474c87 # v1.50
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: 'digger'
asset_name: digger-cli-${{matrix.os}}-${{matrix.arch}}
asset_content_type: application/octet-stream
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.os }}
goarch: ${{ matrix.arch }}
goversion: 1.21.1
project_path: ./cli/cmd/digger
binary_name: digger
pre_command: export CGO_ENABLED=0
ldflags: ${{ matrix.ldflags }}
sha256sum: true
md5sum: false
asset_name: "digger-cli-${{matrix.os}}-${{matrix.arch}}"
compress_assets: "OFF"
7 changes: 4 additions & 3 deletions .github/workflows/cli_test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
name: Cli tests
on:

"on":
push:
pull_request:

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

steps:
- name: Download Go
uses: actions/setup-go@v5
with:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/cli_test_e2e.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
name: Cli e2e tests
on:

"on":
push:
branches: [ 'develop' ]
branches: ['develop']

jobs:
build:
Expand All @@ -11,8 +13,8 @@ jobs:

name: Build
runs-on: ubuntu-latest
steps:

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

Expand Down Expand Up @@ -51,6 +53,3 @@ jobs:
GOOGLE_STORAGE_PLAN_ARTEFACT_BUCKET: gcp-plan-artefacts
AWS_S3_BUCKET: digger-tests-bucket
AWS_REGION: us-east-1



14 changes: 9 additions & 5 deletions .github/workflows/dgctl_release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
---
name: release dgctl
on:

"on":
release:
branches:
- 'go'
types: [released]
types:
- 'released'

jobs:
binary:
strategy:
matrix:
arch: [arm, arm64, amd64, 386]
arch: [arm, arm64, amd64, "386"]
os: [linux, darwin, freebsd, windows]
exclude:
- os: darwin
arch: arm
- os: darwin
arch: 386
arch: "386"

runs-on: ubuntu-latest

Expand All @@ -40,4 +44,4 @@ jobs:
upload_url: ${{ github.event.release.upload_url }}
asset_path: 'dgctl_bin'
asset_name: dgctl-${{matrix.os}}-${{matrix.arch}}
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
6 changes: 4 additions & 2 deletions .github/workflows/ee_backend_docker_release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
name: EE Backend Publish docker image

on:
"on":
release:
types: ['released']
types:
- 'released'

env:
REGISTRY: ghcr.io
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/ee_backend_test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
name: EE Backend Go Tests
on:

"on":
push:
branches: [ develop ]
branches: ['develop']
pull_request:

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

steps:
- name: Download Go
uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -38,6 +39,3 @@ jobs:
env:
GITHUB_PAT_TOKEN: ${{ secrets.TOKEN_GITHUB }}
working-directory: ee/backend



12 changes: 9 additions & 3 deletions .github/workflows/ee_cli_release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
name: release ee cli
on:

"on":
release:
branches:
- 'go'
types: [released]
types:
- 'released'

jobs:
binary:
runs-on: ubuntu-latest

steps:
- name: Download Go
uses: actions/setup-go@v5
Expand All @@ -16,6 +21,7 @@ jobs:

- name: Check out repository
uses: actions/checkout@v4

- name: Build
run: |
echo "Tag that is going to be used as digger version: ${{ github.event.release.tag_name }}"
Expand All @@ -30,4 +36,4 @@ jobs:
upload_url: ${{ github.event.release.upload_url }}
asset_path: 'digger'
asset_name: digger-ee-cli-Linux-X64
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
Loading

0 comments on commit d38a43b

Please sign in to comment.