mirror of https://github.com/antonmedv/fx
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
2.8 KiB
YAML
117 lines
2.8 KiB
YAML
name: release
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- created
|
|
|
|
jobs:
|
|
commit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
ref: master
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.18
|
|
|
|
- name: Get Version
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
|
|
- 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
|
|
git add version.go snap/snapcraft.yaml
|
|
git config --global user.email "github-actions@github.com"
|
|
git config --global user.name "github-actions"
|
|
git commit -m "Release $RELEASE_VERSION"
|
|
git tag "$RELEASE_VERSION" --force
|
|
git push --atomic --force origin master "$RELEASE_VERSION"
|
|
|
|
- name: Test
|
|
run: go test -v ./...
|
|
|
|
binary:
|
|
needs: [commit]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
ref: master
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.18
|
|
|
|
- name: Get Version
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
|
|
- name: Build and Upload
|
|
env:
|
|
FORCE_COLOR: 3
|
|
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
|
|
run: npx zx .github/workflows/release.mjs
|
|
|
|
snap:
|
|
needs: [commit]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
ref: master
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.18
|
|
|
|
- uses: snapcore/action-build@v1
|
|
id: build
|
|
|
|
- uses: snapcore/action-publish@v1
|
|
with:
|
|
store_login: ${{ secrets.STORE_LOGIN }}
|
|
snap: ${{ steps.build.outputs.snap }}
|
|
release: stable
|
|
|
|
brew:
|
|
needs: [commit]
|
|
runs-on: macos-latest
|
|
steps:
|
|
- 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
|
|
|
|
- name: Bump formulae
|
|
uses: Homebrew/actions/bump-formulae@master
|
|
with:
|
|
token: ${{ secrets.MY_TOKEN }}
|
|
formulae: fx
|