Skip to content

Commit

Permalink
Merge branch 'release/v3' into external-rules-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
matttrach authored Jun 27, 2024
2 parents c2a5da2 + 142dc21 commit 30b08ea
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 86 deletions.
75 changes: 0 additions & 75 deletions .drone.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Prerelease

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: build binaries
env:
CROSS: 1
VERSION: ${{ github.ref_name }}
run: |
make build-rancher
- name: package
run: |
make package-rancher
- name: retrieve GPG Credentials
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/key/app-credentials passphrase | GPG_PASSPHRASE ;
secret/data/github/repo/${{ github.repository }}/key/app-credentials privateKey | GPG_KEY
- name: sign shasum
env:
GPG_KEY: ${{ env.GPG_KEY }}
GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
run: |
echo "Importing gpg key"
echo -n "${{ env.GPG_KEY }}" | base64 --decode | gpg --import --batch > /dev/null
echo "signing SHASUM file"
VERSION_NO_V=$(echo ${{ github.ref_name }} | sed "s/^[v|V]//")
SHASUM_FILE=dist/artifacts/${{ github.ref_name }}/terraform-provider-rancher2_"$VERSION_NO_V"_SHA256SUMS
echo ${{ env.GPG_PASSPHRASE }} | gpg --detach-sig --pinentry-mode loopback --passphrase-fd 0 --output "$SHASUM_FILE".sig --sign "$SHASUM_FILE"
- name: GH release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{ github.ref_name }} --prerelease --verify-tag --generate-notes ./dist/artifacts/${{ github.ref_name }}/*
16 changes: 16 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull Request

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build binaries
env:
CROSS: 1
VERSION: ${{ github.ref_name }}
run: |
make build-rancher
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: build binaries
env:
CROSS: 1
VERSION: ${{ github.ref_name }}
run: |
make build-rancher
- name: package
run: |
make package-rancher
- name: retrieve GPG Credentials
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/key/app-credentials passphrase | GPG_PASSPHRASE ;
secret/data/github/repo/${{ github.repository }}/key/app-credentials privateKey | GPG_KEY
- name: sign shasum
env:
GPG_KEY: ${{ env.GPG_KEY }}
GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
run: |
echo "Importing gpg key"
echo -n "${{ env.GPG_KEY }}" | base64 --decode | gpg --import --batch > /dev/null
echo "signing SHASUM file"
VERSION_NO_V=$(echo ${{ github.ref_name }} | sed "s/^[v|V]//")
SHASUM_FILE=dist/artifacts/${{ github.ref_name }}/terraform-provider-rancher2_"$VERSION_NO_V"_SHA256SUMS
echo ${{ env.GPG_PASSPHRASE }} | gpg --detach-sig --pinentry-mode loopback --passphrase-fd 0 --output "$SHASUM_FILE".sig --sign "$SHASUM_FILE"
- name: GH release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{ github.ref_name }} --verify-tag --generate-notes ./dist/artifacts/${{ github.ref_name }}/*
12 changes: 1 addition & 11 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build-rancher: validate-rancher

validate-rancher: validate test

validate: fmtcheck lint vet
validate: fmtcheck vet

package-rancher:
@sh -c "'$(CURDIR)/scripts/gopackage.sh'"
Expand Down Expand Up @@ -47,16 +47,6 @@ vet:
echo "fix them if necessary, before submitting the code for review."; \
fi

lint:
@echo "==> Checking that code complies with golint requirements..."
@GO111MODULE=off go get -u golang.org/x/lint/golint
@if [ -n "$$(golint $$(go list ./...) | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then \
echo ""; \
echo "golint found style issues. Please check the reported issues"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi

bin:
go build -o $(PROVIDER_NAME)

Expand Down

0 comments on commit 30b08ea

Please sign in to comment.