fx/.github/workflows/release.yml

117 lines
2.8 KiB
YAML
Raw Normal View History

2022-04-19 21:56:10 +00:00
name: release
on:
release:
types:
- created
jobs:
2022-04-25 19:22:51 +00:00
commit:
2022-04-19 21:56:10 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2022-04-25 19:22:51 +00:00
with:
ref: master
2022-04-19 21:56:10 +00:00
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
2022-04-25 14:22:42 +00:00
- name: Get Version
2022-04-20 21:08:59 +00:00
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
2022-04-25 14:22:42 +00:00
- name: Update Version
shell: bash
run: |
set -x
sed -i "s/version = .*/version = \"${RELEASE_VERSION}\"/" version.go
sed -i "s/version: .*/version: ${RELEASE_VERSION}/" snap/snapcraft.yaml
2022-04-25 14:28:41 +00:00
git add version.go snap/snapcraft.yaml
2022-04-25 19:22:51 +00:00
git config --global user.email "github-actions@github.com"
2022-04-25 14:22:42 +00:00
git config --global user.name "github-actions"
2022-04-25 19:38:02 +00:00
git commit -m "Release $RELEASE_VERSION"
git tag "$RELEASE_VERSION" --force
git push --atomic --force origin master "$RELEASE_VERSION"
2022-04-25 14:22:42 +00:00
- name: Test
run: go test -v ./...
2022-04-25 14:43:14 +00:00
binary:
2022-04-25 19:22:51 +00:00
needs: [commit]
2022-04-25 14:43:14 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2022-04-25 19:25:34 +00:00
with:
ref: master
2022-04-25 14:43:14 +00:00
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
2022-04-25 19:30:33 +00:00
- name: Get Version
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
2022-04-25 18:49:04 +00:00
- name: Build and Upload
env:
FORCE_COLOR: 3
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
run: npx zx .github/workflows/release.mjs
2022-04-25 14:22:42 +00:00
2022-04-25 14:43:14 +00:00
snap:
2022-04-25 19:22:51 +00:00
needs: [commit]
2022-04-25 14:43:14 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2022-04-25 19:25:34 +00:00
with:
ref: master
2022-04-25 14:43:14 +00:00
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
2022-04-25 18:49:04 +00:00
- uses: snapcore/action-build@v1
id: build
2022-04-25 14:22:42 +00:00
2022-04-25 18:49:04 +00:00
- uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{ steps.build.outputs.snap }}
release: stable
2022-05-03 06:31:14 +00:00
brew:
needs: [commit]
2022-05-08 13:45:18 +00:00
runs-on: macos-latest
2022-05-03 06:31:14 +00:00
steps:
2022-05-08 13:45:18 +00:00
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
test-bot: false
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v2
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems
- name: Configure Git user
uses: Homebrew/actions/git-user-config@master
- name: Update brew
run: brew update
2022-05-03 06:31:14 +00:00
- name: Bump formulae
uses: Homebrew/actions/bump-formulae@master
with:
token: ${{ secrets.MY_TOKEN }}
formulae: fx