Skip to content

Commit

Permalink
feat: build on self-hosted runners
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Vasilenko <maksim.vasilenko@flant.com>
  • Loading branch information
Maxim Vasilenko committed Nov 18, 2024
1 parent 45c1aca commit dc19b25
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: [self-hosted, regular]
container:
image: ubuntu:22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # To use `git describe --tags`

- name: Install dependency for linux-amd64 dist
env:
DEBIAN_FRONTEND: noninteractive
run: apt-get update && apt-get install -y apt-utils libbtrfs-dev file git

- name: Setup Go
uses: actions/setup-go@v5
with:
Expand All @@ -34,11 +41,13 @@ jobs:
- name: Setup Task
uses: arduino/setup-task@v2

- name: Setup private repo
run: git config --global url."https://gitlab-ci-token:${PRIVATE_REPO_TOKEN}@${PRIVATE_REPO}/".insteadOf https://${PRIVATE_REPO}/
- name: Setup git
run: |
git config --global url."https://gitlab-ci-token:${PRIVATE_REPO_TOKEN}@${PRIVATE_REPO}/".insteadOf https://${PRIVATE_REPO}/
git config --global --add safe.directory '*'
- name: Build and package
run: task build-and-package
run: cd ${GITHUB_WORKSPACE} && task build-and-package

- name: Release
uses: softprops/action-gh-release@v2
Expand All @@ -49,8 +58,15 @@ jobs:
test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
runs-on: [self-hosted, regular]
container:
image: ubuntu:22.04
steps:
- name: Install dependency for linux-amd64 dist
env:
DEBIAN_FRONTEND: noninteractive
run: apt-get update && apt-get install -y apt-utils libbtrfs-dev file git

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -64,8 +80,10 @@ jobs:
- name: Setup Task
uses: arduino/setup-task@v2

- name: Setup private repo
run: git config --global url."https://gitlab-ci-token:${PRIVATE_REPO_TOKEN}@${PRIVATE_REPO}/".insteadOf https://${PRIVATE_REPO}/
- name: Setup git
run: |
git config --global url."https://gitlab-ci-token:${PRIVATE_REPO_TOKEN}@${PRIVATE_REPO}/".insteadOf https://${PRIVATE_REPO}/
git config --global --add safe.directory '*'
- name: Run tests
run: task test
run: pwd && ls -lah . && task test

0 comments on commit dc19b25

Please sign in to comment.