Skip to content

Commit

Permalink
fix release action
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-aschlackman committed Oct 16, 2024
1 parent 2723ecd commit 10cc27d
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 109 deletions.
108 changes: 0 additions & 108 deletions .github/workflows/go.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/go.yml.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Go

on:
release:
types: ["published"]

jobs:
build-packages:
name: Build Release Packages
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go

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

- name: Build
run: |
go mod init crucible_provider
cd cmd
GOOS=linux GOARCH=386 go build -o ../terraform-provider-crucible_${{ github.event.release.tag_name }}_linux_386
GOOS=linux GOARCH=amd64 go build -o ../terraform-provider-crucible_${{ github.event.release.tag_name }}_linux_amd64
GOOS=darwin GOARCH=amd64 go build -o ../terraform-provider-crucible_${{ github.event.release.tag_name }}_darwin_amd64
GOOS=windows GOARCH=386 go build -o ../terraform-provider-crucible_${{ github.event.release.tag_name }}_windows_386.exe
GOOS=windows GOARCH=amd64 go build -o ../terraform-provider-crucible_${{ github.event.release.tag_name }}_windows_amd64.exe

- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: terraform-provider-crucible_${{ github.event.release.tag_name }}_linux_386 application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: terraform-provider-crucible_${{ github.event.release.tag_name }}_linux_amd64 application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: terraform-provider-crucible_${{ github.event.release.tag_name }}_darwin_amd64 application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: terraform-provider-crucible_${{ github.event.release.tag_name }}_windows_386.exe application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: terraform-provider-crucible_${{ github.event.release.tag_name }}_windows_amd64.exe application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-docker-image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
id: prep
run: |
DOCKER_IMAGE=cmusei/terraform-crucible-provider
VERSION=${{ github.event.release.tag_name }}
TAGS="${DOCKER_IMAGE}:${VERSION}"
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: |
VERSION=${{ github.event.release.tag_name }}
push: ${{ startsWith(github.ref, 'refs/tags/') }}
tags: ${{ steps.prep.outputs.tags }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GitHub sets this automatically
Expand Down

0 comments on commit 10cc27d

Please sign in to comment.