Release #7
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: Release | |
on: | |
push: | |
tags: ["v*"] | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
linux: | |
name: Linux | |
runs-on: ubuntu-latest | |
environment: Linux | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install depends | |
run: | | |
sudo apt update && sudo apt install upx rename -y | |
- name: Get tag | |
if: startsWith(github.ref, 'refs/tags/') | |
id: tag | |
uses: dawidd6/action-get-tag@v1 | |
with: | |
strip_v: true | |
- name: Tag Check | |
run: | | |
echo "tag=${{ steps.tag.outputs.tag }}" >> $GITHUB_ENV | |
echo "tag=${{ steps.tag.outputs.tag }}" >> $GITHUB_OUTPUT | |
if [ -z "${{ steps.tag.outputs.tag }}" ]; then | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
echo "tag=latest" >> $GITHUB_ENV | |
fi | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build package | |
shell: bash | |
env: | |
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
rmi=true os=linux bash +x build.sh | |
- name: Upload binaries to GitHub Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
uploads/* | |
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }} | |
generate_release_notes: true | |
docker: | |
name: Build Docker Image | |
runs-on: ubuntu-latest | |
needs: [ linux ] | |
environment: Docker | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Get tag | |
if: startsWith(github.ref, 'refs/tags/') | |
id: tag | |
uses: dawidd6/action-get-tag@v1 | |
with: | |
strip_v: true | |
- name: Login to DockerHub | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Login to GitHub Container Registry | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
cd docker | |
tag=${{ steps.tag.outputs.tag }} bash +x build.sh | |
cd - | |
- name: Docker Hub Description | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} |