Nightly Rolling Release #98
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
name: "Nightly Rolling Release" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 00 08 * * * | |
jobs: | |
ci-update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-tags: true | |
fetch-depth: 0 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/build-push-action@v4 | |
with: | |
context: .devcontainer/ | |
file: ".devcontainer/Dockerfile" | |
tags: devcontainer:latest | |
load: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: false | |
- name: "Run Makefile target: ci-update" | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: devcontainer:latest | |
options: -v ${{ github.workspace }}:/repo -w /repo --user vscode | |
run: | | |
echo "Running In Devcontainer" | |
. /etc/profile | |
echo "ID: $(id)" | |
echo "Dir: $PWD" | |
echo "PATH: $PATH" | |
echo "Files:" | |
ls -la | sed 's/^/ /' | |
echo "Setting file ownership" | |
sudo chown -R $(id -u) . | |
echo "Running make target" | |
make ci-update | |
- name: GIT Push new version | |
id: git-push | |
run: | | |
set -x | |
set -e | |
sudo chown -R $(id -u) . | |
git log -n 3 | |
git tag -l | tail -n 3 | |
if git merge-base --is-ancestor HEAD '@{u}'; then | |
echo "git_status=clean" | tee -a "$GITHUB_OUTPUT" | |
else | |
git push | |
git push --tags | |
echo "git_status=pushed" | tee -a "$GITHUB_OUTPUT" | |
fi | |
# Release to github | |
- name: Free Disk Space (Ubuntu) | |
if: steps.git-push.outputs.git_status == 'pushed' | |
uses: jlumbroso/[email protected] | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- name: Setup Golang | |
if: steps.git-push.outputs.git_status == 'pushed' | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Import GPG key | |
if: steps.git-push.outputs.git_status == 'pushed' | |
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 | |
id: import_gpg | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
- name: Run GoReleaser | |
if: steps.git-push.outputs.git_status == 'pushed' | |
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 | |
with: | |
args: release --clean --release-notes CHANGELOG-FOR-GO-RELEASER.md.tmp | |
env: | |
# GitHub sets the GITHUB_TOKEN secret automatically. | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} |