Skip to content

Commit 2c61de4

Browse files
author
Sergei Kuvakin
committed
feat: added gh actions
1 parent 4df3558 commit 2c61de4

File tree

3 files changed

+48
-57
lines changed

3 files changed

+48
-57
lines changed

.github/workflows/actions.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: actions
2+
on: push
3+
jobs:
4+
qemu-user-static:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Set variables
9+
run: |
10+
echo "RELEASE=${RELEASE}" >> $GITHUB_ENV
11+
echo "BUILD=${BUILD}" >> $GITHUB_ENV
12+
echo "DOCKER_SERVER=${DOCKER_SERVER}" >> $GITHUB_ENV
13+
echo "PACKAGE_URI=${PACKAGE_URI}" >> $GITHUB_ENV
14+
echo "VERSION=$RELEASE-$(echo $BUILD | sed 's/\..*//')" >> $GITHUB_ENV
15+
echo "DOCKER_REPO=$DOCKER_SERVER/$GITHUB_REPOSITORY" >> $GITHUB_ENV
16+
env:
17+
RELEASE: 5.1.0
18+
BUILD: 7.fc34
19+
# See qemu-user-static's RPM spec file on Fedora to check the new version.
20+
# https://src.fedoraproject.org/rpms/qemu/blob/master/f/qemu.spec
21+
DOCKER_SERVER: docker.io
22+
PACKAGE_URI: https://kojipkgs.fedoraproject.org/packages/qemu
23+
- name: Build releases
24+
run: |
25+
sudo apt install rpm2cpio cpio
26+
PACKAGE_URI=$PACKAGE_URI/$RELEASE/$BUILD/x86_64/qemu-user-static-$RELEASE-$BUILD.x86_64.rpm
27+
wget --content-disposition $PACKAGE_URI
28+
rpm2cpio $(basename "$PACKAGE_URI") | cpio -dimv
29+
./generate_tarballs.sh
30+
- name: Publish releases
31+
if: github.ref == 'refs/heads/master'
32+
run: |
33+
sudo apt install jq
34+
./publish.sh -v "$VERSION" -t ${{ secrets.GITHUB_TOKEN }} -r "$GITHUB_REPOSITORY"
35+
- name: Build images
36+
if: github.ref == 'refs/heads/master'
37+
run: |
38+
./update.sh -v "$VERSION" -t "$VERSION" -r "$GITHUB_REPOSITORY" -d "$DOCKER_REPO"
39+
- name: Test images
40+
run: |
41+
docker images
42+
./test.sh -d "$DOCKER_REPO"
43+
- name: Publish images
44+
if: github.ref == 'refs/heads/master'
45+
run: |
46+
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }}
47+
docker push $DOCKER_REPO

.travis.yml

-56
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# qemu-user-static
22

3-
[![License](https://img.shields.io/github/license/multiarch/qemu-user-static.svg?style=flat-square)](./LICENSE) [![Build Status](https://img.shields.io/travis/multiarch/qemu-user-static/master.svg?style=flat-square&logo=travis)](https://travis-ci.org/multiarch/qemu-user-static/builds) [![Releases](https://img.shields.io/github/commits-since/multiarch/qemu-user-static/latest.svg?style=flat-square)](https://github.com/multiarch/qemu-user-static/releases) [![Docker Hub](https://img.shields.io/docker/pulls/multiarch/qemu-user-static.svg?style=flat-square)](https://hub.docker.com/r/multiarch/qemu-user-static/)
3+
[![License](https://img.shields.io/github/license/multiarch/qemu-user-static.svg?style=flat-square)](./LICENSE) ![actions](https://github.com/multiarch/qemu-user-static/workflows/actions/badge.svg) [![Releases](https://img.shields.io/github/commits-since/multiarch/qemu-user-static/latest.svg?style=flat-square)](https://github.com/multiarch/qemu-user-static/releases) [![Docker Hub](https://img.shields.io/docker/pulls/multiarch/qemu-user-static.svg?style=flat-square)](https://hub.docker.com/r/multiarch/qemu-user-static/)
44

55
![](https://raw.githubusercontent.com/multiarch/dockerfile/master/logo.jpg)
66

0 commit comments

Comments
 (0)