ci: remove stripping for release package #4
Workflow file for this run
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: Package | |
# Run workflow on tags starting with v (eg. v2, v1.2.0) | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
Package-Docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/${{ github.repository }} | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=semver,pattern={{raw}} | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | |
type=ref,event=branch | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v2 | |
with: | |
file: ./cmd/ical-relay/Dockerfile | |
platforms: linux/amd64,linux/arm64,linux/arm | |
push: true # Will only build if this is not here | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
Compile: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [amd64, arm64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18.0' # The Go version to download (if necessary) and use. | |
- run: go generate cmd/ical-relay/main.go | |
- run: env GOOS=linux GOARCH=${{ matrix.arch }} go build -o ./bin/ical-relay ./cmd/ical-relay/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ical-relay_${{ matrix.arch }} | |
path: ./bin/ical-relay | |
Package-deb: | |
needs: Compile | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [amd64, arm64] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Create debpkg structure | |
run: | | |
mkdir -p cmd/ical-relay/.debpkg/etc/ical-relay | |
mkdir -p cmd/ical-relay/.debpkg/opt/ical-relay | |
cp cmd/ical-relay/config.yml.example cmd/ical-relay/.debpkg/etc/ical-relay/ | |
cp -r cmd/ical-relay/templates cmd/ical-relay/.debpkg/opt/ical-relay/templates/ | |
mkdir -p cmd/ical-relay/.debpkg/etc/systemd/system/ | |
cp cmd/ical-relay/misc/ical-relay.service cmd/ical-relay/.debpkg/etc/systemd/system/ | |
mkdir -p cmd/ical-relay/.debpkg/DEBIAN | |
cp cmd/ical-relay/misc/postinstall.sh cmd/ical-relay/.debpkg/DEBIAN/postinst | |
chmod +x cmd/ical-relay/.debpkg/DEBIAN/postinst | |
- name: Download binary | |
uses: actions/download-artifact@v3 | |
id: download | |
with: | |
name: ical-relay_${{ matrix.arch }} | |
- run: | | |
mkdir -p cmd/ical-relay/.debpkg/usr/bin | |
cp ${{steps.download.outputs.download-path}}/ical-relay cmd/ical-relay/.debpkg/usr/bin/ | |
chmod +x cmd/ical-relay/.debpkg/usr/bin/ical-relay_${{ matrix.arch }} | |
- uses: jiro4989/build-deb-action@v2 | |
id: package | |
with: | |
package: ical-relay | |
package_root: ./cmd/ical-relay/.debpkg | |
maintainer: Julian Lemmerich <mail@julian-lemmerich.de> | |
version: ${{ github.ref }} # refs/tags/v*.*.* | |
arch: '${{ matrix.arch }}' | |
desc: 'Relay ical urls and edit them on the fly with different modules.' | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ical-relay_${{ matrix.arch }}.deb | |
path: ${{steps.package.outputs.file_name}} | |