Skip to content

Release

Release #50

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
commit_branch:
description: The branch or the commit sha to push tag to
required: true
tag:
description: The tag of the release
required: true
is_latest_release:
description: Is this the latest release
type: boolean
required: true
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_branch }}
fetch-depth: 0
fetch-tags: true
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Free disk space
run: rm -rf /opt/hostedtoolcache
# Docker login
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
- run: |
TAG=${{ github.event.inputs.tag }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
# Build and push docker image
- name: Build docker image
uses: docker/build-push-action@v4
with:
target: release
push: true
build-args: VERSION=${{ env.VERSION }}
tags: |
peersyst/exrp:${{ github.event.inputs.tag }}
${{ fromJSON('["", "peersyst/exrp:latest"]')[github.event.inputs.is_latest_release == 'true'] }}
- name: Publish the Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
prerelease: steps.check-prerelease.outputs.match == 'true'
target_commitish: ${{ github.event.inputs.commit_branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run go releaser
run: |
docker run --rm -e CGO_ENABLED -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
-v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/go/src/exrp -w /go/src/exrp \
goreleaser/goreleaser-cross:v1.22 release --clean --skip validate