Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added conf in release #27

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 25 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: release
name: Build and release

permissions: write-all

jobs:
build:
name: build release
name: Build release
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -22,47 +22,47 @@ jobs:
- windows
- darwin
go-version:
- '1.22'
- '1.23'
include:
- arch: amd64
rpm_arch: x86_64
- arch: arm64
rpm_arch: aarch64
env:
GOPRIVATE: github.com/anyproto

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '${{ matrix.go-version }}'
check-latest: true

- name: git config
run: git config --global url.https://${{ secrets.ANYTYPE_PAT }}@github.com/.insteadOf https://github.com/

# build {{
- name: deps
- name: Install deps
run: make deps CGO_ENABLED=0

#- name: unit tests
# run: make test CGO_ENABLED=0

- name: build
- name: Build
run: make build CGO_ENABLED=0 BUILD_GOOS=${{ matrix.os}} BUILD_GOARCH=${{ matrix.arch }}
# }}

- name: get release version
- name: Get release version
id: release-version
run: |
echo "$GITHUB_REF_NAME" | sed 's|^[a-zA-Z]\+|RELEASE_VERSION=|' >> $GITHUB_OUTPUT
echo "$GITHUB_REF_NAME" | sed 's|^[a-zA-Z]\+|RELEASE_VERSION_RPM=|; s|-|_|g' >> $GITHUB_OUTPUT # FPM automatically converts versions for RPM

- name: Copy config file in ./bin
run: cp ./any-sync-network/defaultTemplate.yml ./bin/

# create asset {{
- name: create zip archive
- name: Create zip | Windows
if: matrix.os == 'windows'
run: |
zip --junk-paths ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip bin/*
- name: create tar archive

- name: Create tar | Linux and Darwin
if: matrix.os != 'windows'
run: |
tar \
Expand All @@ -73,7 +73,7 @@ jobs:
--file=${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz \
--directory=bin/ \
.
- name: create package deb
- name: Create package | Deb
if: matrix.os == 'linux'
uses: fb929/github-action-fpm@master
with:
Expand All @@ -86,7 +86,8 @@ jobs:
--input-type dir
--output-type deb
fpm_args: ./bin
- name: create package rpm

- name: Create package | Rpm
if: matrix.os == 'linux'
uses: fb929/github-action-fpm@master
with:
Expand All @@ -101,48 +102,45 @@ jobs:
fpm_args: ./bin
# }}

- name: debug
- name: Debug
run: |
ls -al ./

# upload-release-asset {{
- name: Create release and upload asset zip
uses: softprops/action-gh-release@v2.0.4
uses: softprops/action-gh-release@v2
if: matrix.os == 'windows'
with:
name: Release ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
# for triggering workflow "push-docker-image-release" - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
token: ${{ secrets.ANYTYPE_PAT }}
files: |
./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip
${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip

- name: Create release and upload asset tgz
uses: softprops/action-gh-release@v2.0.4
uses: softprops/action-gh-release@v2
if: matrix.os != 'windows'
with:
name: Release ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
# for triggering workflow "push-docker-image-release" - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
token: ${{ secrets.ANYTYPE_PAT }}
files: |
./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz
${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz

- name: Create release and upload assets deb and rpm
uses: softprops/action-gh-release@v2.0.4
uses: softprops/action-gh-release@v2
if: matrix.os == 'linux'
with:
name: Release ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
# for triggering workflow "push-docker-image-release" - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
token: ${{ secrets.ANYTYPE_PAT }}
files: |
./${{ github.event.repository.name }}_${{ steps.release-version.outputs.RELEASE_VERSION }}_${{ matrix.arch }}.deb
./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION_RPM }}-1.${{ matrix.rpm_arch }}.rpm
${{ github.event.repository.name }}_${{ steps.release-version.outputs.RELEASE_VERSION }}_${{ matrix.arch }}.deb
${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION_RPM }}-1.${{ matrix.rpm_arch }}.rpm
# }}
2 changes: 1 addition & 1 deletion any-sync-network/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ func defaultCoordinatorNode() CoordinatorNodeConfig {
Spaces string "yaml:\"spaces\""
}{
Log: "log",
Spaces: "space",
Spaces: "spaces",
},
SpaceStatus: struct {
RunSeconds int "yaml:\"runSeconds\""
Expand Down
Loading