-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from pipelinit/feat/release_automation
New release automation
- Loading branch information
Showing
3 changed files
with
134 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Release new version | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
PRERELEASE: true | ||
|
||
jobs: | ||
release: | ||
name: Build and publish new release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set current version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.14.0 | ||
|
||
- name: Build Linux x86_64 binary | ||
env: | ||
BUILD_TARGET: "x86_64-unknown-linux-gnu" | ||
RELEASE_VERSION: "${{ env.RELEASE_VERSION }}" | ||
run: | | ||
cd cli; deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run build.ts | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
tags: | | ||
type=semver,pattern={{version}},enable=true | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
build-args: "version=${{ env.RELEASE_VERSION }}" | ||
context: cli/ | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Build Windows x86_64 binary | ||
env: | ||
BUILD_TARGET: "x86_64-pc-windows-msvc" | ||
RELEASE_VERSION: "${{ env.RELEASE_VERSION }}" | ||
run: | | ||
cd cli | ||
deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run build.ts | ||
- name: Build Mac x86_64 binary | ||
env: | ||
BUILD_TARGET: "x86_64-apple-darwin" | ||
RELEASE_VERSION: "${{ env.RELEASE_VERSION }}" | ||
run: | | ||
cd cli | ||
deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run build.ts | ||
- name: Build Mac aarch64 binary | ||
env: | ||
BUILD_TARGET: "aarch64-apple-darwin" | ||
RELEASE_VERSION: "${{ env.RELEASE_VERSION }}" | ||
run: | | ||
cd cli | ||
deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run build.ts | ||
- name: Publish the release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: "Pipelinit ${{ env.RELEASE_VERSION }}" | ||
prerelease: ${{ env.PRELEASE }} | ||
tag_name: ${{ env.RELEASE_VERSION }} | ||
files: | | ||
cli/bin/pipelinit-${{ env.RELEASE_VERSION }}-x86_64-unknown-linux-gnu.tar.gz | ||
cli/bin/pipelinit-${{ env.RELEASE_VERSION }}-x86_64-pc-windows-msvc.zip | ||
cli/bin/pipelinit-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin.tar.gz | ||
cli/bin/pipelinit-${{ env.RELEASE_VERSION }}-aarch64-apple-darwin.tar.gz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM debian:11-slim | ||
|
||
ARG version | ||
COPY bin/pipelinit-${version}-x86_64-unknown-linux-gnu /pipelinit | ||
|
||
VOLUME ["/app"] | ||
|
||
WORKDIR /app | ||
|
||
ENTRYPOINT ["/pipelinit"] |
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