Docker Image CI #804
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
schedule: | |
- cron: '0 */24 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Prepare workspace | |
run: mkdir workspace | |
- name: Build the WireGuard tools (wg) | |
run: | | |
cat build-wg-tools.sh | docker run --rm -i -v="$PWD/workspace:/workspace" -w="/workspace" gcc:latest sh | |
ls ./workspace/wireguard-tools/src/wg | |
ls ./workspace/wireguard-tools/src/wg-quick/linux.bash | |
- name: Get version | |
id: getver | |
run: echo "::set-output name=body::`./workspace/wireguard-tools/src/wg --version | head -n 1 | cut -d ' ' -f 2`" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.getver.outputs.body }} | |
release_name: Release ${{ steps.getver.outputs.body }} | |
body: Binary build for Linux system with amd64 architecture. | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset-1 | |
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: ./workspace/wireguard-tools/src/wg | |
asset_name: wg | |
asset_content_type: application/octet-stream | |
- name: Upload Release Asset | |
id: upload-release-asset-2 | |
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: ./workspace/wireguard-tools/src/wg-quick/linux.bash | |
asset_name: linux.bash | |
asset_content_type: text/plain |