Skip to content

Bump version to 0.4.0 #19

Bump version to 0.4.0

Bump version to 0.4.0 #19

Workflow file for this run

name: Make a new release
on:
push:
tags:
- v*.*.*
jobs:
publish-docker:
runs-on: [self-hosted, Linux]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/DefGuard/defguard-proxy
tags: |
type=raw,value=latest
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Login to GitHub container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[registry."docker.io"]
mirrors = ["dockerhub-proxy.teonite.net"]
- name: Build container
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
create-release:
name: create-release
runs-on: self-hosted
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- name: Create GitHub release
id: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
generate_release_notes: true
build-binaries:
needs: [ "create-release" ]
runs-on:
- self-hosted
- ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [ linux, linux-arm, linux-arm64, freebsd ]
include:
- build: linux
os: Linux
target: x86_64-unknown-linux-gnu
- build: linux-arm
os: Linux
target: armv7-unknown-linux-gnueabihf
- build: linux-arm64
os: Linux
target: aarch64-unknown-linux-gnu
- build: freebsd
os: Linux
target: x86_64-unknown-freebsd
steps:
# Store the version, stripping any v-prefix
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[registry."docker.io"]
mirrors = ["dockerhub-proxy.teonite.net"]
- name: Build release binary
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --locked --release --target ${{ matrix.target }}
- name: Rename binary
run: mv target/${{ matrix.target }}/release/defguard-proxy defguard-proxy-${{ github.ref_name }}-${{ matrix.target }}
- name: Tar
uses: a7ul/[email protected]
with:
command: c
files: |
defguard-proxy-${{ github.ref_name }}-${{ matrix.target }}
outPath: defguard-proxy-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
- name: Upload release archive
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: defguard-proxy-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
asset_name: defguard-proxy-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
asset_content_type: application/octet-stream