Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable GitHub actions #165

Merged
merged 1 commit into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Main
on: [push, pull_request]
jobs:
test-main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: docker build -t slirp4netns-tests -f Dockerfile.tests .
- run: docker run --rm --privileged slirp4netns-tests
test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: DOCKER_BUILDKIT=1 docker build -f Dockerfile.buildtests .
artifact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: DOCKER_BUILDKIT=1 docker build -o /tmp/artifact --target artifact -f Dockerfile.buildtests .
- run: (cd /tmp/artifact; sha256sum *)
- uses: actions/upload-artifact@v1
with:
name: slirp4netns-x86_64
path: /tmp/artifact/slirp4netns
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this becomes zip :(

actions/upload-artifact#3

29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release
on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: DOCKER_BUILDKIT=1 docker build -o /tmp/artifact --target artifact -f Dockerfile.buildtests .
- run: (cd /tmp/artifact; sha256sum *)
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/artifact/slirp4netns
asset_name: slirp4netns-x86_64
asset_content_type: application/octet-stream
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions Dockerfile.buildtests
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ RUN ./autogen.sh
FROM buildtest-opensuse151-common AS buildtest-opensuse151-dynamic
RUN ./configure && make && cp -f slirp4netns /

# artifact for GitHub actions
FROM scratch AS artifact
COPY --from=buildtest-alpine310-static /slirp4netns /slirp4netns

FROM scratch AS buildtest-final-stage
COPY --from=buildtest-alpine310-static /slirp4netns /buildtest-alpine310-static
COPY --from=buildtest-ubuntu1804-dynamic /slirp4netns /buildtest-ubuntu1804-dynamic
Expand Down