feat(dns): honor use_vpn_dns on Linux by renaming /etc/resolv.conf (#84) #53
This file contains hidden or 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
| name: release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "test-release" | |
| - "[0-9]+\\.[0-9]+" | |
| jobs: | |
| create-release: | |
| name: create-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: create release | |
| uses: actions/create-release@v1 | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: ${{ github.ref }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-archlinux: | |
| name: build-archlinux | |
| needs: ["create-release"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: build package | |
| id: build_package | |
| uses: PinkD/arch-pkgbuild-builder@v2.4 | |
| with: | |
| target: "pkgbuild" | |
| pkgname: "pack" | |
| - name: upload package to artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: archlinux-package | |
| path: pack/corplink-rs-*.pkg.tar.zst | |
| - name: upload package to release | |
| uses: svenstaro/upload-release-action@v2 | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: pack/corplink-rs-${{ github.ref_name }}*.pkg.tar.zst | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| file_glob: true | |
| - name: create tarball | |
| run: | | |
| cp pack/pkg/corplink-rs/usr/bin/corplink-rs . | |
| cp config/config.json . | |
| tar -czf corplink-rs-${{ github.ref_name }}-linux-$(uname -m).tar.gz corplink-rs config.json | |
| - name: upload tarball to artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: linux-tarball | |
| path: corplink-rs-${{ github.ref_name }}*.tar.gz | |
| - name: upload tarball to release | |
| uses: svenstaro/upload-release-action@v2 | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: corplink-rs-${{ github.ref_name }}*.tar.gz | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| file_glob: true | |
| build-macos: | |
| name: build-macos | |
| needs: ["create-release"] | |
| runs-on: macos-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: setup go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ">=1.22.0" | |
| - name: build libwg | |
| run: cd libwg && ./build.sh | |
| - name: build package | |
| run: cargo build --release | |
| - name: build tarball | |
| run: | | |
| cd target | |
| cp release/corplink-rs . | |
| cp ../config/config.json . | |
| tar -czf corplink-rs-${{ github.ref_name }}-macos-$(uname -m).tar.gz corplink-rs config.json | |
| - name: upload package to artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: macos-tarball | |
| path: target/corplink-rs-*.tar.gz | |
| - name: upload package to release | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: target/corplink-rs-*.tar.gz | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| file_glob: true | |
| build-windows: | |
| name: build-windows | |
| needs: ["create-release"] | |
| runs-on: windows-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: setup go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ">=1.22.0" | |
| - name: build libwg | |
| run: cd libwg && ./build.ps1 | |
| - name: rust install gnu toolchain | |
| run: rustup toolchain install stable-gnu | |
| - name: rust use gnu toolchain | |
| run: rustup default stable-x86_64-pc-windows-gnu | |
| - name: build package | |
| run: cargo build --release | |
| - name: build check result | |
| run: | | |
| Move-Item -Path "target/release/corplink-rs.exe" -Destination "." | |
| Move-Item -Path "config/config.json" -Destination "." | |
| Compress-Archive -Path corplink-rs.exe,config.json -Destination corplink-rs-${{ github.ref_name }}-windows.zip | |
| - name: upload package to artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: windows-zip | |
| path: corplink-rs-${{ github.ref_name }}-windows.zip | |
| - name: upload package to release | |
| uses: svenstaro/upload-release-action@v2 | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: corplink-rs-${{ github.ref_name }}-windows.zip | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| file_glob: true |