forked from tidbyt/pixlet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(release): Move release to GitHub Actions. (tidbyt#104)
* feat(release): Move release to GitHub Actions. This commit moves our release process to GitHub actions. The way this used to work was through our internal build system which makes it really hard to give any visibility to anyone else. In addition, we were hitting the limits of our local macOS build system and needed an upgraded agent. * Split workflows. This commit splits workflows so that pull requests and main have differnt workflows. * Update .github/workflows/main.yml Co-authored-by: Rohan Singh <[email protected]> Co-authored-by: Rohan Singh <[email protected]>
- Loading branch information
1 parent
84046d8
commit 48d115c
Showing
6 changed files
with
137 additions
and
36 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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: pixlet | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build-and-test-release: | ||
name: Build and Test Release Artifacts | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16.12' | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Linux dependencies | ||
if: matrix.os == 'ubuntu-latest' | ||
run: sudo ./scripts/setup-linux.sh | ||
|
||
- name: Install macOS dependencies | ||
if: matrix.os == 'macos-latest' | ||
run: ./scripts/setup-macos.sh | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Build Release Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
run: make release-linux | ||
|
||
- name: Build Release macOS | ||
if: matrix.os == 'macos-latest' | ||
run: make release-macos | ||
|
||
- name: Upload Release Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: release-artifacts | ||
path: build | ||
|
||
create-release: | ||
name: Create Github Release | ||
runs-on: ubuntu-latest | ||
environment: release | ||
needs: build-and-test-release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16.12' | ||
|
||
- name: Fetch Release Artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: release-artifacts | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: ${{github.ref_name}} | ||
args: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TIDBYT_GITHUB_TOKEN }} |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
dpkg --add-architecture arm64 | ||
|
||
cat <<EOT > /etc/apt/sources.list | ||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main restricted | ||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-updates main restricted | ||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal universe | ||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-updates universe | ||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal multiverse | ||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-updates multiverse | ||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse | ||
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ focal-security main restricted | ||
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ focal-security universe | ||
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ focal-security multiverse | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main restricted | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal universe | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates universe | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal multiverse | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates multiverse | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-security main restricted | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-security universe | ||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-security multiverse | ||
EOT | ||
|
||
apt-get update | ||
apt-get install -y \ | ||
libwebp-dev \ | ||
libwebp-dev:arm64 \ | ||
crossbuild-essential-arm64 |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
brew install \ | ||
webp \ | ||
gnupg |