Skip to content

Merge branch 'main' into gh_main #26

Merge branch 'main' into gh_main

Merge branch 'main' into gh_main #26

Workflow file for this run

name: Build
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
push_to_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
pull: true
push: true
# cache-from: type=registry,ref=myorg/myrepository:latest
# cache-to: type=inline
tags: ghcr.io/${{ github.repository }}:latest
# musl_builder:
# name: Musl build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# target: x86_64-unknown-linux-musl
# override: true
# - uses: actions-rs/cargo@v1
# with:
# command: build
# args: --release --target x86_64-unknown-linux-musl
gnulinux_builder:
name: GNU/Linux build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
# - uses: actions/upload-artifact@v3
# with:
# name: gitlabjob-bin
# path: target/release/gitlabjob
- 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 Release Asset
id: upload-release-asset
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: ./target/release/gitlabjobber
asset_name: gitlabjobber
asset_content_type: application/bin