Skip to content

ci: update github actions #58

ci: update github actions

ci: update github actions #58

Workflow file for this run

name: CI
on: [push, workflow_dispatch]
jobs:
license-compliance:
runs-on: ubuntu-latest
container:
image: joinself/license-finder:go
steps:
- uses: actions/checkout@v4
- name: License check
shell: bash
run: |
export HOME=/root
source /root/.profile
license_finder --decisions_file ./.github/license_finder.yml
secret-scan:
runs-on: ubuntu-latest
container:
image: zricethezav/gitleaks:v8.2.4
options: --entrypoint "" --user root
steps:
- uses: actions/checkout@v4
- name: Secret scan
shell: bash
run: gitleaks detect -c ./.github/gitleaks.toml --redact -v
build:
runs-on: ubuntu-latest
container:
image: golang:1.19.1
steps:
- uses: actions/checkout@v4
- name: Build packages
shell: bash
run: |
GOOS=linux GOARCH=amd64 go build -o self-cli-linux-amd64
GOOS=darwin GOARCH=amd64 go build -o self-cli-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -o self-cli-darwin-arm64
GOOS=windows GOARCH=amd64 go build -o self-cli-windows-amd64
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: self-cli-*
retention-days: 3
release:
needs: [license-compliance, secret-scan, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: artifacts
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fetch_all_tags: true
tag_prefix:
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
artifacts: 'self-cli-linux-amd64,self-cli-darwin-amd64,self-cli-darwin-arm64,self-cli-windows-amd64'
if: github.ref == 'refs/heads/main'