forked from syncthing/syncthing
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
319a8aa
commit 7c4e2d6
Showing
1 changed file
with
33 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,61 +3,52 @@ name: release | |
on: | ||
push: | ||
tags: | ||
- "v*" | ||
- "v*" | ||
|
||
jobs: | ||
release-nhctl: | ||
name: Release nhctl | ||
|
||
build-syncthing-linux-amd64: | ||
name: Build syncthing amd64 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.14 | ||
|
||
- name: Checkout nocalhost | ||
uses: actions/[email protected] | ||
with: | ||
repository: nocalhost/nocalhost | ||
ref: feature/actions/syncthing | ||
|
||
- name: Get tag | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.15.6 | ||
|
||
- name: Get commit id | ||
run: echo "NH_COMMIT_ID=$(git describe --match=NeVeRmAtCh --always --abbrev=40 --dirty)" >> $GITHUB_ENV | ||
- name: Get tag | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Checkout syncthing | ||
uses: actions/[email protected] | ||
with: | ||
repository: nocalhost/syncthing | ||
path: ./syncthing-source | ||
ref: nh-release | ||
- name: Checkout syncthing | ||
uses: actions/[email protected] | ||
with: | ||
repository: nocalhost/syncthing | ||
path: ./syncthing-source | ||
ref: main | ||
|
||
- name: Build syncthing | ||
working-directory: ./syncthing-source | ||
run: ./build.sh artifact all ${{ env.RELEASE_VERSION }} ${{ env.NH_COMMIT_ID }} | ||
- name: Build syncthing-amd64 | ||
working-directory: ./syncthing-source | ||
run: go run build.go -targetName=syncthing -cmd=tar -nocalhostVersion=${{ env.RELEASE_VERSION }} -nocalhostCommitId="${GITHUB_SHA}" | ||
|
||
- name: Push to Coding Articact | ||
working-directory: ./syncthing-source | ||
env: | ||
VERSION: ${{ env.RELEASE_VERSION }} | ||
run: | | ||
curl -T syncthing-linux-amd64.tar.gz -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://codingcorp-generic.pkg.coding.net/nocalhost/syncthing/syncthing-linux-amd64.tar.gz?version=${VERSION}" | ||
curl -T syncthing-linux-arm64.tar.gz -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://codingcorp-generic.pkg.coding.net/nocalhost/syncthing/syncthing-linux-arm64.tar.gz?version=${VERSION}" | ||
curl -T syncthing-macos-amd64.zip -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://codingcorp-generic.pkg.coding.net/nocalhost/syncthing/syncthing-macos-amd64.zip?version=${VERSION}" | ||
curl -T syncthing-windows-amd64.zip -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://codingcorp-generic.pkg.coding.net/nocalhost/syncthing/syncthing-windows-amd64.zip?version=${VERSION}" | ||
- name: Push to Coding Articact | ||
working-directory: ./syncthing-source | ||
run: | | ||
curl -T syncthing-linux-amd64.tar.gz -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://codingcorp-generic.pkg.coding.net/nocalhost/syncthing/syncthing-linux-amd64.tar.gz?version=${{ env.RELEASE_VERSION }}" | ||
build-syncthing-windows: | ||
name: Build syncthing windows | ||
runs-on: windows-latest | ||
build-syncthing-macos: | ||
name: Build syncthing macos | ||
runs-on: macos-latest | ||
steps: | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.15.6 | ||
|
||
- name: Get tag | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Checkout syncthing | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -68,10 +59,11 @@ jobs: | |
- name: Build syncthing | ||
working-directory: ./syncthing-source | ||
run: | | ||
set RELEASE_VERSION="${{github.ref}}".Split("/")["${{github.ref}}".Split("/").Length -1] | ||
go run build.go -targetName=syncthing -cmd=zip -nocalhostVersion="$RELEASE_VERSION" -nocalhostCommitId=%GITHUB_SHA% | ||
go run build.go -targetName=syncthing -cmd=zip -nocalhostVersion=${{ env.RELEASE_VERSION }} -nocalhostCommitId="${GITHUB_SHA}" | ||
go run build.go -targetName=syncthing -cmd=zip -nocalhostVersion=${{ env.RELEASE_VERSION }} -nocalhostCommitId="${GITHUB_SHA}" -goos=windows | ||
- name: Push to Coding Articact | ||
working-directory: ./syncthing-source | ||
run: | | ||
curl -T syncthing-windows-amd64.zip -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://codingcorp-generic.pkg.coding.net/nocalhost/syncthing/syncthing-windows-amd64.zip?version=$RELEASE_VERSION" | ||
curl -T syncthing-macos-amd64.zip -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://codingcorp-generic.pkg.coding.net/nocalhost/syncthing/syncthing-macos-amd64.zip?version=${{ env.RELEASE_VERSION }}" | ||
curl -T syncthing-windows-amd64.zip -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://codingcorp-generic.pkg.coding.net/nocalhost/syncthing/syncthing-windows-amd64.zip?version=${{ env.RELEASE_VERSION }}" |