Skip to content

Merge pull request #3 from thedadams/checksums-without-star #49

Merge pull request #3 from thedadams/checksums-without-star

Merge pull request #3 from thedadams/checksums-without-star #49

Workflow file for this run

name: build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
env:
DESTDIR: ./bin
GO_VERSION: 1.21.10
jobs:
validate:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
target:
- lint
- validate-vendor
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Run
run: |
make ${{ matrix.target }}
build:
runs-on: ubuntu-22.04
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
run: |
make release
env:
CACHE_FROM: type=gha,scope=build
CACHE_TO: type=gha,scope=build,mode=max
-
name: Rename and list artifacts
run: |
mv ./bin/gptscript-credential-pass*darwin-amd64 ./bin/gptscript-credential-pass-darwin-amd64
mv ./bin/gptscript-credential-pass*darwin-arm64 ./bin/gptscript-credential-pass-darwin-arm64
mv ./bin/gptscript-credential-pass*linux-amd64 ./bin/gptscript-credential-pass-linux-amd64
mv ./bin/gptscript-credential-pass*linux-arm64 ./bin/gptscript-credential-pass-linux-arm64
mv ./bin/gptscript-credential-secretservice*linux-amd64 ./bin/gptscript-credential-secretservice-linux-amd64
mv ./bin/gptscript-credential-secretservice*linux-arm64 ./bin/gptscript-credential-secretservice-linux-arm64
tree -nh ${{ env.DESTDIR }}
-
name: Check artifacts
run: |
find ${{ env.DESTDIR }} -type f -exec file -e ascii -e text -- {} +
-
name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gptscript-credential-helpers
path: ${{ env.DESTDIR }}/*
if-no-files-found: error
windows_build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
run: |
make build-wincred
mv ${{ env.DESTDIR }}/gptscript-credential-wincred ${{ env.DESTDIR }}/gptscript-credential-wincred.exe
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: gptscript-credential-helpers-windows
path: ${{ env.DESTDIR }}/*wincred*
if-no-files-found: error
create_release:
runs-on: ubuntu-latest
needs: [ build, windows_build ]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- run: sleep 10
- name: Download all artifacts
uses: actions/download-artifact@v4
- run: ls -lR
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: |
./*
makeLatest: ${{ !contains(github.ref_name, '-rc') }}
generateReleaseNotes: true
prerelease: ${{ contains(github.ref_name, '-rc') }}
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}