diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3972072f467..0fb64d1e77f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,54 +3,42 @@ 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/checkout@v2.3.4 - 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/checkout@v2.3.4 - with: - repository: nocalhost/syncthing - path: ./syncthing-source - ref: nh-release + - name: Checkout syncthing + uses: actions/checkout@v2.3.4 + 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 @@ -58,6 +46,9 @@ jobs: with: go-version: ^1.15.6 + - name: Get tag + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Checkout syncthing uses: actions/checkout@v2.3.4 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 }}"