Skip to content

Commit

Permalink
Simplify workflows (#244)
Browse files Browse the repository at this point in the history
* Simplify workflows

* fix

* save

* save

* fix build deps

* update build deps

* update build deps

* save
  • Loading branch information
leonitousconforti committed Sep 4, 2024
1 parent 3e8ebcf commit 7f1beed
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 123 deletions.
45 changes: 4 additions & 41 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,16 @@ runs:
steps:
# Setup go and node
- uses: actions/setup-go@v5
with:
cache-dependency-path: |
submodules/wireguard-go/go.sum
- uses: actions/setup-node@v4
with:
node-version: "18.x"

# Setup pnpm and pnpm cache
- name: "Install pnpm"
uses: pnpm/action-setup@v4
with:
run_install: false
- name: "Get pnpm store"
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: "Setup pnpm cache"
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-node18.x-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node18.x-pnpm-store-
# Install dependencies
- run: sudo apt-get update
shell: bash
- run: sudo apt-get install mingw-w64 imagemagick libarchive-tools build-essential flex bison dwarves libssl-dev libelf-dev bc ccache librsvg2-bin fakeroot debhelper libtool-bin cmake -y
shell: bash
# Setup pnpm
- uses: pnpm/action-setup@v4

# Setup wireguard windows dist cache
- name: "Setup wireguard windows dist cache"
uses: actions/cache@v4
with:
path: /tmp/wireguard-windows-distfiles
key: wireguard-windows-dist
# Install build deps
- shell: bash
run: |
mkdir -p /tmp/wireguard-windows-distfiles/.distfiles/
cp -r /tmp/wireguard-windows-distfiles/.distfiles/ submodules/wireguard-windows/.distfiles
ls -la submodules/wireguard-windows/.distfiles
run: sudo apt-get -y install mingw-w64 libarchive-tools

# Check, lint, and build
- shell: bash
Expand All @@ -58,12 +27,6 @@ runs:
- shell: bash
run: pnpm build

# Cache wireguard windows dist
- shell: bash
run: |
cp -r submodules/wireguard-windows/.distfiles/ /tmp/wireguard-windows-distfiles
ls -la /tmp/wireguard-windows-distfiles
# Clean up
- shell: bash
run: |
Expand Down
11 changes: 0 additions & 11 deletions .github/actions/e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,5 @@ runs:
run: tar -xvf /tmp/the-wireguard-effect/the-wireguard-effect.tar
- shell: bash
run: pnpm install
- shell: bash
run: sudo apt-get install -y openresolv
- shell: bash
run: |
sudo groupadd wireguard-control
sudo usermod -a -G wireguard-control root
sudo usermod -a -G wireguard-control runner
sudo mkdir -p /var/run/wireguard/
sudo chown -R root:wireguard-control /var/run/wireguard/
sudo setcap "all=ep" ./dist/prebuilds/linux-amd64-wireguard-go
- shell: bash
run: pnpm e2e-tests
13 changes: 3 additions & 10 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,13 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "18.x"

- name: "Install pnpm"
uses: pnpm/action-setup@v4
with:
run_install: false
- run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: "Setup pnpm cache"
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-node18.x-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- run: pnpm install
- run: pnpm docgen

- uses: actions/configure-pages@v5
- uses: actions/jekyll-build-pages@v1
with:
Expand Down
58 changes: 21 additions & 37 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,35 @@ jobs:
with:
submodules: 'true'

# Setup go and node
- uses: actions/setup-go@v5
with:
cache-dependency-path: |
submodules/wireguard-go/go.sum
- uses: actions/setup-node@v4
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org/"

- name: "Install pnpm"
uses: pnpm/action-setup@v4
with:
run_install: false
- name: "Get pnpm store"
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: "Setup pnpm cache"
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-node18.x-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node18.x-pnpm-store-
- run: sudo apt-get update
- run: sudo apt-get install mingw-w64 imagemagick libarchive-tools build-essential flex bison dwarves libssl-dev libelf-dev bc ccache librsvg2-bin fakeroot debhelper libtool-bin cmake -y

- name: "Setup wireguard windows dist cache"
uses: actions/cache@v4
with:
path: /tmp/wireguard-windows-distfiles
key: wireguard-windows-dist
- run: mkdir -p /tmp/wireguard-windows-distfiles/.distfiles/
- run: cp -r /tmp/wireguard-windows-distfiles/.distfiles/ submodules/wireguard-windows/.distfiles
- run: ls -la submodules/wireguard-windows/.distfiles

- run: pnpm install
- run: pnpm check
- run: pnpm lint
- run: pnpm build

- run: pnpm publish --no-git-checks --access public --registry https://registry.npmjs.org/
# Setup pnpm and pnpm cache
- uses: pnpm/action-setup@v4

# Install build deps
- shell: bash
run: sudo apt-get -y install mingw-w64 libarchive-tools

# Check, lint, and build
- shell: bash
run: pnpm install
- shell: bash
run: pnpm check
- shell: bash
run: pnpm lint
- shell: bash
run: pnpm build

# Publish to npm
- run: pnpm publish --access public --registry https://registry.npmjs.org/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Publish to GitHub Packages
- uses: actions/setup-node@v4
with:
node-version: "18.x"
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/snapshot.yml

This file was deleted.

0 comments on commit 7f1beed

Please sign in to comment.