mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-02-14 18:09:51 +00:00
chore: changed CI step order and add trigger for tags
This commit is contained in:
61
.github/workflows/ci.yaml
vendored
61
.github/workflows/ci.yaml
vendored
@@ -2,14 +2,18 @@ name: CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.15.x, 1.16.x]
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
go-version: [1.16.x]
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Install Go
|
||||
@@ -20,15 +24,16 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
- name: Test
|
||||
run: go test ./...
|
||||
- name: Run vet & lint
|
||||
- name: Run lint/vet
|
||||
run: |
|
||||
go vet .
|
||||
golint .
|
||||
go get -u golang.org/x/lint/golint
|
||||
golint ./...
|
||||
go vet ./...
|
||||
|
||||
create-release:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upload_url: ${{ steps.goreleaser.outputs.upload_url }}
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Download release notes utility
|
||||
env:
|
||||
@@ -37,9 +42,20 @@ jobs:
|
||||
- name: Generate release notes
|
||||
run: |
|
||||
echo 'CHANGELOG' > /tmp/release.txt
|
||||
github-release-notes -org rancherfederal -repo hauler -since-latest-release -include-author >> /tmp/release.txt
|
||||
#github-release-notes -org rancherfederal -repo hauler -since-latest-release -include-author >> /tmp/release.txt
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
- name: Build and run Hauler package build
|
||||
run: |
|
||||
mkdir bin
|
||||
go build -o bin ./cmd/...
|
||||
./bin/hauler package build
|
||||
- name: Run GoReleaser
|
||||
id: goreleaser
|
||||
uses: goreleaser/goreleaser-action@v1
|
||||
@@ -47,31 +63,4 @@ jobs:
|
||||
version: latest
|
||||
args: release --release-notes=/tmp/release.txt
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload assets
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: hauler
|
||||
path: dist/hauler_linux_amd64/haulerctl
|
||||
retention-days: 2
|
||||
|
||||
create-artifacts:
|
||||
runs-on: ubuntu-latest
|
||||
needs: create-release
|
||||
steps:
|
||||
- name: Download Hauler binary
|
||||
id: download
|
||||
uses: actions/download-artifact@v2
|
||||
- name: Run Hauler bundle
|
||||
run: chmod +x haulerctl && ./haulerctl create
|
||||
- name: Upload default package to Release
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs,create-release.outputs.upload_url }}
|
||||
asset_path: ${{github.workspace}}/haul.tar.zst
|
||||
asset_name: haul.tar.zst
|
||||
asset_content_type: application/zstd
|
||||
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -11,4 +11,6 @@ builds:
|
||||
- CGO_ENABLED=0
|
||||
flags:
|
||||
- -tags=containers_image_openpgp containers_image_ostree
|
||||
|
||||
release:
|
||||
extra_files:
|
||||
- glob: ./pkg.tar.zst
|
||||
Reference in New Issue
Block a user