Add fixers #1078
Workflow file for this run
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: Build selene | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build_windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Build (Default features) | |
run: | | |
cd selene | |
cargo build --locked --release | |
- name: Upload selene | |
uses: actions/upload-artifact@v1 | |
with: | |
name: selene-windows | |
path: ./target/release/selene.exe | |
build_windows_light: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Build (Lightweight) | |
run: | | |
cd selene | |
cargo build --locked --release --verbose --no-default-features | |
- name: Upload selene-light | |
uses: actions/upload-artifact@v1 | |
with: | |
name: selene-light-windows | |
path: ./target/release/selene.exe | |
build_mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Rust | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
- name: Build (Default features) | |
run: | | |
source $HOME/.cargo/env | |
cd selene | |
cargo build --locked --release | |
- name: Upload selene | |
uses: actions/upload-artifact@v1 | |
with: | |
name: selene-macos | |
path: ./target/release/selene | |
build_mac_light: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Rust | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
- name: Build (Lightweight) | |
run: | | |
source $HOME/.cargo/env | |
cd selene | |
cargo build --locked --release --verbose --no-default-features | |
- name: Upload selene-light | |
uses: actions/upload-artifact@v1 | |
with: | |
name: selene-light-macos | |
path: ./target/release/selene | |
build_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Build (Default features) | |
run: | | |
cd selene | |
cargo build --locked --release | |
- name: Upload selene | |
uses: actions/upload-artifact@v1 | |
with: | |
name: selene-linux | |
path: ./target/release/selene | |
build_linux_light: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Build (Lightweight) | |
run: | | |
cd selene | |
cargo build --locked --release --verbose --no-default-features | |
- name: Upload selene-light | |
uses: actions/upload-artifact@v1 | |
with: | |
name: selene-light-linux | |
path: ./target/release/selene | |
release: | |
runs-on: ubuntu-latest | |
needs: ['build_windows_light', 'build_windows', 'build_mac', 'build_mac_light', 'build_linux', 'build_linux_light'] | |
if: contains(github.event.head_commit.message, '[release]') | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- run: | | |
zip -rj selene-light-linux.zip ./artifacts/selene-light-linux/* | |
zip -rj selene-light-macos.zip ./artifacts/selene-light-macos/* | |
zip -rj selene-light-windows.zip ./artifacts/selene-light-windows/* | |
zip -rj selene-linux.zip ./artifacts/selene-linux/* | |
zip -rj selene-macos.zip ./artifacts/selene-macos/* | |
zip -rj selene-windows.zip ./artifacts/selene-windows/* | |
VERSION=`grep -Po '(?<=^version = ")([^"]+)' ./Cargo.toml` | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Get changelog | |
run: | | |
CHANGELOG_ENTRY=`grep --color=never -m 1 -Po '## \K(\[[0-9\.]+\].+)' CHANGELOG.md | sed -E 's/\(.+?\)//g'` | |
DESCRIPTION=`bash ./misc/extract-changelog.sh $CHANGELOG_ENTRY` | |
echo "CHANGELOG_ENTRY=$CHANGELOG_ENTRY" >> $GITHUB_ENV | |
echo "CHANGELOG_DESCRIPTION<<EOF" >> $GITHUB_ENV | |
echo "$DESCRIPTION" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: ${{ env.CHANGELOG_ENTRY }} | |
body: ${{ env.CHANGELOG_DESCRIPTION }} | |
- name: Upload Linux build | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./selene-linux.zip | |
asset_name: selene-${{ env.VERSION }}-linux.zip | |
asset_content_type: application/zip | |
- name: Upload Linux build (light) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./selene-light-linux.zip | |
asset_name: selene-light-${{ env.VERSION }}-linux.zip | |
asset_content_type: application/zip | |
- name: Upload Windows build | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./selene-windows.zip | |
asset_name: selene-${{ env.VERSION }}-windows.zip | |
asset_content_type: application/zip | |
- name: Upload Windows build (light) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./selene-light-windows.zip | |
asset_name: selene-light-${{ env.VERSION }}-windows.zip | |
asset_content_type: application/zip | |
- name: Upload Mac build | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./selene-macos.zip | |
asset_name: selene-${{ env.VERSION }}-macos.zip | |
asset_content_type: application/zip | |
- name: Upload Mac build (light) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./selene-light-macos.zip | |
asset_name: selene-light-${{ env.VERSION }}-macos.zip | |
asset_content_type: application/zip | |
- uses: actions/checkout@v1 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: boyned/selene | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |