Skip to content

Commit

Permalink
Update plugin to support ARM64 build (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
misraved authored Apr 27, 2022
1 parent d2765e3 commit 5d05d5f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 48 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.18.*'
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.45
args: --timeout=5m
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
args: --timeout=10m
48 changes: 16 additions & 32 deletions .github/workflows/registry-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ name: Build and Deploy OCI Image
on:
push:
tags:
- "v*"
- 'v*'

env:
PROJECT_ID: steampipe
ORG: turbot
PLUGIN_REPO: us-docker.pkg.dev/steampipe/plugins
CONFIG_SCHEMA_VERSION: "2020-11-18"
CONFIG_SCHEMA_VERSION: '2020-11-18'

jobs:
build:
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: Get latest version tag
run: |-
Expand Down Expand Up @@ -105,40 +105,18 @@ jobs:
path: ./dist/steampipe-plugin-${{ env.PLUGIN_NAME }}_darwin_amd64.gz
if-no-files-found: error

# test-amd64:
# name: Integration Test
# runs-on: ${{ matrix.os }}
# needs: build
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# steps:

# test-darwin-amd64:
# name: Test MacOS (AMD64)
# runs-on: macos-latest
# needs: build

# test-linux-amd64:
# name: Test Linux (AMD64)
# runs-on: ubuntu-latest
# needs: build

# test-windows-amd64:
# name: Test Windows (AMD64)
# runs-on: windows-latest
# needs: build

# There are no runners for amd64 - would need to run our own...
- name: Save MacOS Build Artifact - ARM64
uses: actions/upload-artifact@v2
with:
name: steampipe-${{ env.PLUGIN_NAME }}_darwin_arm64
path: ./dist/steampipe-plugin-${{ env.PLUGIN_NAME }}_darwin_arm64.gz
if-no-files-found: error

publish-deploy:
name: Publish and Deploy
runs-on: ubuntu-latest
needs:
- build
# - test-darwin-amd64
# - test-linux-amd64
# - test-windows-amd64

steps:
- name: Checkout
Expand Down Expand Up @@ -182,6 +160,11 @@ jobs:
with:
name: steampipe-${{ env.PLUGIN_NAME }}_darwin_amd64

- name: Download darwin_arm64 artifact
uses: actions/download-artifact@v2
with:
name: steampipe-${{ env.PLUGIN_NAME }}_darwin_arm64

- name: List files
run: ls -l

Expand Down Expand Up @@ -253,6 +236,7 @@ jobs:
--manifest-config config.json:application/vnd.turbot.steampipe.config.v1+json \
--manifest-annotations annotations.json \
steampipe-plugin-${PLUGIN_NAME}_darwin_amd64.gz:application/vnd.turbot.steampipe.plugin.darwin-amd64.layer.v1+gzip \
steampipe-plugin-${PLUGIN_NAME}_darwin_arm64.gz:application/vnd.turbot.steampipe.plugin.darwin-arm64.layer.v1+gzip \
steampipe-plugin-${PLUGIN_NAME}_linux_amd64.gz:application/vnd.turbot.steampipe.plugin.linux-amd64.layer.v1+gzip \
steampipe-plugin-${PLUGIN_NAME}_linux_arm64.gz:application/vnd.turbot.steampipe.plugin.linux-arm64.layer.v1+gzip \
docs:application/vnd.turbot.steampipe.plugin.docs.layer.v1+tar \
Expand Down Expand Up @@ -319,5 +303,5 @@ jobs:
uses: ./.github/actions/semver-tags
id: semver
with:
image-to-tag: "${{ env.PLUGIN_REPO }}/${{ env.ORG }}/${{ env.PLUGIN_NAME }}:${{ github.run_id }}"
image-to-tag: '${{ env.PLUGIN_REPO }}/${{ env.ORG }}/${{ env.PLUGIN_NAME }}:${{ github.run_id }}'
image-version: ${{ env.VERSION }}
17 changes: 7 additions & 10 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,25 @@ builds:
goos:
- linux
- darwin
#- windows #- not yet.....

goarch:
- amd64
- arm64
ignore:
- goos: darwin # docs suggest that darwin arm64 should compile, but doesnt...
goarch: arm64

id: "steampipe-azure"
binary: '{{ .ProjectName }}.plugin'
id: "steampipe"
binary: "{{ .ProjectName }}.plugin"

archives:
- format: gz
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
files:
- none*
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^docs:"
- "^test:"

0 comments on commit 5d05d5f

Please sign in to comment.