Skip to content

publish

publish #417

Workflow file for this run

name: publish
on:
push:
branches: [master]
tags: ['*']
workflow_dispatch:
env:
GO_VERSION: '>=1.21.5'
jobs:
create-packages-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Mage
run: |
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go
- name: Build OpenSSL 3.0
run: |
wget https://github.com/openssl/openssl/releases/download/openssl-3.0.8/openssl-3.0.8.tar.gz
tar -xvf openssl-3.0.8.tar.gz
cd openssl-3.0.8/
./Configure --prefix=${GITHUB_WORKSPACE}/openssl no-shared
make && make install
- name: Setup GoReleaser
run: |
curl -O -L https://github.com/goreleaser/goreleaser/releases/download/v1.12.3/goreleaser_1.12.3_amd64.deb
sudo dpkg -i goreleaser_1.12.3_amd64.deb
rm goreleaser_1.12.3_amd64.deb
- name: Set GoReleaser flags
id: set-goreleaser-flags
run: |
if ${{ startsWith(github.ref, 'refs/tags') }} ; then
echo "::set-output name=GORELEASER_FLAGS::--rm-dist --skip-validate"
else
echo "::set-output name=GORELEASER_FLAGS::--rm-dist --snapshot"
fi
# These scripts will be picked up while building packages with goreleaser.
- name: Generate ZSH and Bash completion scripts
run: |
mage build
./tt completion bash > tt-completion.bash
./tt completion zsh > tt-completion.zsh
- name: Build packages
env:
CGO_LDFLAGS: "-L${{ env.GITHUB_WORKSPACE }}/openssl/lib64"
CGO_CFLAGS: "-I${{ env.GITHUB_WORKSPACE }}/openssl/include"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
goreleaser release ${{ steps.set-goreleaser-flags.outputs.GORELEASER_FLAGS }} --skip-publish --config ./goreleaser/.goreleaser_linux.yml
- name: Upload packages artifacts
uses: actions/upload-artifact@v3
with:
name: packages-linux
path: dist
create-packages-linux-arm64:
runs-on: graviton
strategy:
fail-fast: false
container:
image: tarantool/testing:tt-build
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
submodules: recursive
- name: Install etcd
uses: ./.github/actions/setup-etcd
- name: Set GoReleaser flags
id: set-goreleaser-flags
run: |
if ${{ startsWith(github.ref, 'refs/tags') }} ; then
echo "::set-output name=GORELEASER_FLAGS::--rm-dist --skip-validate"
else
echo "::set-output name=GORELEASER_FLAGS::--rm-dist --snapshot"
fi
# These scripts will be picked up while building packages with goreleaser.
- name: Generate ZSH and Bash completion scripts
run: |
mage build
./tt completion bash > tt-completion.bash
./tt completion zsh > tt-completion.zsh
- name: Build packages
env:
CGO_LDFLAGS: "-L/opt/openssl/lib"
CGO_CFLAGS: "-I/opt/openssl/include"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
goreleaser release ${{ steps.set-goreleaser-flags.outputs.GORELEASER_FLAGS }} \
--skip-publish --config ./goreleaser/.goreleaser_linux_arm64.yml
- name: Upload packages artifacts
uses: actions/upload-artifact@v3
with:
name: packages-linux-arm64
path: dist
create-packages-macos:
runs-on: macos-13
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Mage
run: |
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go
- name: Install OpenSSL 3.0
run: |
brew install openssl
- name: Setup GoReleaser
run: |
brew install goreleaser
- name: Set GoReleaser flags
id: set-goreleaser-flags
run: |
if ${{ startsWith(github.ref, 'refs/tags') }} ; then
echo "::set-output name=GORELEASER_FLAGS::--rm-dist --skip-validate"
else
echo "::set-output name=GORELEASER_FLAGS::--rm-dist --snapshot"
fi
- name: Build packages
env:
CGO_LDFLAGS: "-L/usr/local/opt/openssl/lib -lssl -lcrypto"
CGO_CFLAGS: "-I/usr/local/opt/openssl/include -Wno-deprecated-declarations"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
goreleaser release ${{ steps.set-goreleaser-flags.outputs.GORELEASER_FLAGS }} --skip-publish --config ./goreleaser/.goreleaser_macOS.yml
- name: Upload packages artifacts
uses: actions/upload-artifact@v3
with:
name: packages-macos
path: dist