Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pixiake committed Jun 15, 2021
2 parents 2b1347f + 2154012 commit 18f0bb2
Showing 1 changed file with 103 additions and 0 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/build-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]



jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Build dependencies (centos7)
run: |
docker build -t centos7-dependencies:${{ steps.get_version.outputs.VERSION }} . -f dockerfile.centos7
docker run --rm -v /package:/pkgs centos7-dependencies:${{ steps.get_version.outputs.VERSION }} /bin/cp -f centos-7-amd64-debs.tar.gz /pkgs/centos-7-amd64-debs.tar.gz
- name: Build dependencies (ubuntu 16.04)
run: |
docker build -t ubuntu1604-dependencies:${{ steps.get_version.outputs.VERSION }} . -f dockerfile.ubuntu1604
docker run --rm -v /package:/pkgs ubuntu1604-dependencies:${{ steps.get_version.outputs.VERSION }} /bin/cp -f ubuntu-16.04-amd64-debs.tar.gz /pkgs/ubuntu-16.04-amd64-debs.tar.gz
- name: Build dependencies (ubuntu 18.04)
run: |
docker build -t ubuntu1804-dependencies:${{ steps.get_version.outputs.VERSION }} . -f dockerfile.ubuntu1804
docker run --rm -v /package:/pkgs ubuntu1804-dependencies:${{ steps.get_version.outputs.VERSION }} /bin/cp -f ubuntu-18.04-amd64-debs.tar.gz /pkgs/ubuntu-18.04-amd64-debs.tar.gz
- name: Build dependencies (ubuntu 20.04)
run: |
docker build -t ubuntu1804-dependencies:${{ steps.get_version.outputs.VERSION }} . -f dockerfile.ubuntu2004
docker run --rm -v /package:/pkgs ubuntu2004-dependencies:${{ steps.get_version.outputs.VERSION }} /bin/cp -f ubuntu-20.04-amd64-debs.tar.gz /pkgs/ubuntu-20.04-amd64-debs.tar.gz
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false


- name: Upload centos7 dependencies
id: upload-centos-7-dependencies
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /package/centos-7-amd64-rpms.tar.gz
asset_name: centos-7-amd64-rpms.tar.gz
asset_content_type: application/tar.gz

- name: Upload ubuntu1604 dependencies
id: upload-ubuntu-1604-dependencies
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /package/ubuntu-16.04-amd64-debs.tar.gz
asset_name: ubuntu-16.04-amd64-debs.tar.gz
asset_content_type: application/tar.gz

- name: Upload ubuntu1804 dependencies
id: upload-ubuntu-1804-dependencies
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /package/ubuntu-18.04-amd64-debs.tar.gz
asset_name: ubuntu-18.04-amd64-debs.tar.gz
asset_content_type: application/tar.gz

- name: Upload ubuntu2004 dependencies
id: upload-ubuntu-2004-dependencies
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /package/ubuntu-20.04-amd64-debs.tar.gz
asset_name: ubuntu-20.04-amd64-debs.tar.gz
asset_content_type: application/tar.gz

0 comments on commit 18f0bb2

Please sign in to comment.