Skip to content

Commit

Permalink
Add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adeepn committed May 18, 2023
1 parent b4fd9af commit b0c17b2
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/jh-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: JH build

on:
release:
types: ["published"]
pull_request:
branches: ["main-jethub"]
workflow_dispatch:


env:
GOLANG_VERSION: "1.16"

jobs:
build:
name: Build OS-Agent
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/[email protected]
with:
fetch-depth: 0 # Needed for changelog generation

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Setup go ${{ env.GOLANG_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GOLANG_VERSION }}

- name: Run GoReleaser build
uses: goreleaser/[email protected]
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
with:
args: build --snapshot --clean

- name: Run GoReleaser release
uses: goreleaser/[email protected]
if: github.event_name == 'release'
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- uses: robinraju/[email protected]
with:
repository: ${{ github.repository }}
latest: true
fileName: "*.deb"
out-file-path: debs

- name: List files
id: listfiles
run: |
echo 'files<<EOF' >> $GITHUB_OUTPUT
echo "$(ls debs/)" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Deploy to server
if: 1
uses: jethome-iot/actions/repo-upload@master
with:
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_KNOWNHOSTS_UPLOAD: ${{ secrets.SSH_KNOWNHOSTS_UPLOAD }}
distro: bullseye
path: debs
files: ${{ steps.listfiles.outputs.files }}
branch: test

- name: Upload packets
uses: actions/upload-artifact@v2
with:
name: debs
path: debs

0 comments on commit b0c17b2

Please sign in to comment.