Skip to content

Release Demo Services #39

Release Demo Services

Release Demo Services #39

Workflow file for this run

name: Release Demo Services
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
######################
#### MEMBERSHIP ####
######################
membership:
runs-on:
labels: ubuntu-latest
steps:
- name: Store new version in env
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.TAG }}
- name: Set env
id: vars
run: |
SHORT_COMMIT=$(git rev-parse --short HEAD)
echo "short_commit=${SHORT_COMMIT}" >> $GITHUB_ENV
- name: Install GemFury CLI
run: |
sudo bash -c "echo 'deb [trusted=yes] https://apt.fury.io/cli/ * *' > /etc/apt/sources.list.d/fury-cli.list"
sudo apt-get update
sudo apt-get install -y fury-cli
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Release Membership Linux Package
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
workdir: membership
env:
FURY_ACCOUNT: ${{ secrets.FURY_ACCOUNT }}
FURY_API_TOKEN: ${{ secrets.FURY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
######################
#### FRONTEND ####
######################
frontend:
runs-on:
labels: ubuntu-latest
steps:
- name: Store new version in env
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.TAG }}
- name: Install GemFury CLI
run: |
sudo bash -c "echo 'deb [trusted=yes] https://apt.fury.io/cli/ * *' > /etc/apt/sources.list.d/fury-cli.list"
sudo apt-get update
sudo apt-get install -y fury-cli
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Release
working-directory: frontend
env:
FURY_ACCOUNT: ${{ secrets.FURY_ACCOUNT }}
FURY_API_TOKEN: ${{ secrets.FURY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker build -t frontend .
docker cp $(docker create --name tc frontend):/app ./dist && docker rm tc
sed -i -E 's/version: .*$/version: '"${TAG}"'/' nfpm.yaml
nfpm pkg --packager rpm --target dist/
nfpm pkg --packager deb --target dist/
fury push --public --account $FURY_ACCOUNT --api-token $FURY_API_TOKEN dist/*.rpm
fury push --public --account $FURY_ACCOUNT --api-token $FURY_API_TOKEN dist/*.deb
######################
#### INVENTORY ####
######################
inventory:
runs-on:
labels: ubuntu-latest
steps:
- name: Store new version in env
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.TAG }}
- name: Install GemFury CLI
run: |
sudo bash -c "echo 'deb [trusted=yes] https://apt.fury.io/cli/ * *' > /etc/apt/sources.list.d/fury-cli.list"
sudo apt-get update
sudo apt-get install -y fury-cli
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Release
working-directory: inventory
env:
FURY_ACCOUNT: ${{ secrets.FURY_ACCOUNT }}
FURY_API_TOKEN: ${{ secrets.FURY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker build -t inventory .
docker create --name tc inventory
mkdir -p ./dist/app
docker cp tc:/app ./dist/app
docker cp tc:/usr/local/lib/python3.11/site-packages ./dist/app/site-packages
docker rm tc
sed -i -E 's/version: .*$/version: '"${TAG}"'/' nfpm.yaml
nfpm pkg --packager rpm --target dist/
nfpm pkg --packager deb --target dist/
fury push --public --account $FURY_ACCOUNT --api-token $FURY_API_TOKEN dist/*.rpm
fury push --public --account $FURY_ACCOUNT --api-token $FURY_API_TOKEN dist/*.deb
######################
#### COUPON ####
######################
coupon:
runs-on:
labels: ubuntu-latest
steps:
- name: Store new version in env
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.TAG }}
- name: Install GemFury CLI
run: |
sudo bash -c "echo 'deb [trusted=yes] https://apt.fury.io/cli/ * *' > /etc/apt/sources.list.d/fury-cli.list"
sudo apt-get update
sudo apt-get install -y fury-cli
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Release
working-directory: coupon
env:
FURY_ACCOUNT: ${{ secrets.FURY_ACCOUNT }}
FURY_API_TOKEN: ${{ secrets.FURY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker build -t coupon .
docker create --name tc coupon
mkdir -p ./dist/app
docker cp tc:/app ./dist/app
docker rm tc
sed -i -E 's/version: .*$/version: '"${TAG}"'/' nfpm.yaml
nfpm pkg --packager rpm --target dist/
nfpm pkg --packager deb --target dist/
fury push --public --account $FURY_ACCOUNT --api-token $FURY_API_TOKEN dist/*.rpm
fury push --public --account $FURY_ACCOUNT --api-token $FURY_API_TOKEN dist/*.deb
######################
#### PRICING ####
######################
pricing:
runs-on:
labels: ubuntu-latest
steps:
- name: Store new version in env
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.TAG }}
- name: Install GemFury CLI
run: |
sudo bash -c "echo 'deb [trusted=yes] https://apt.fury.io/cli/ * *' > /etc/apt/sources.list.d/fury-cli.list"
sudo apt-get update
sudo apt-get install -y fury-cli
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Release
working-directory: pricing
env:
FURY_ACCOUNT: ${{ secrets.FURY_ACCOUNT }}
FURY_API_TOKEN: ${{ secrets.FURY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker build -t pricing .
docker create --name tc pricing
mkdir -p ./dist/app
docker cp tc:/app ./dist/app
docker rm tc
sed -i -E 's/version: .*$/version: '"${TAG}"'/' nfpm.yaml
nfpm pkg --packager rpm --target dist/
nfpm pkg --packager deb --target dist/
fury push --public --account $FURY_ACCOUNT --api-token $FURY_API_TOKEN dist/*.rpm
fury push --public --account $FURY_ACCOUNT --api-token $FURY_API_TOKEN dist/*.deb