diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3b55b83 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: build and upload assets + +on: + push: + tags: + - 'v*' + +permissions: + contents: read + +env: + # Use invalid OSB key to packages with ZIP support but without valid build in password + OSB_KEY: "invalid" + +jobs: + linuxbuild: + runs-on: ubuntu-latest + permissions: + packages: write + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + - name: Run tests + run: cargo test --verbose + - run: make linux-package + - name: Release + if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + uses: softprops/action-gh-release@v2 + with: + files: | + *linux.tar.gz + windowsbuild: + runs-on: windows-latest + permissions: + packages: write + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + - name: Run tests + run: cargo test --verbose + - run: make win-package + - name: Release + if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + uses: softprops/action-gh-release@v2 + with: + files: | + *win64.zip \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b21d630..d0d5596 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,50 +1,26 @@ -name: Create release and upload assets +name: release-please on: push: - tags: - - 'v*' + branches: [ 'master' ] -env: - # Use invalid OSB key to packages with ZIP support but without valid build in password - OSB_KEY: "invalid" +permissions: + contents: read jobs: - linuxbuild: + release-please: + name: run release-please runs-on: ubuntu-latest - defaults: - run: - shell: bash + permissions: + contents: write + pull-requests: write steps: - - uses: actions/checkout@v4 - - name: Run tests - run: cargo test --verbose - - run: make linux-package - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') + - uses: actions/create-github-app-token@v2 + id: app-token with: - draft: 'true' - make_latest: 'true' - generate_release_notes: 'true' - files: | - *linux.tar.gz - windowsbuild: - runs-on: windows-latest - defaults: - run: - shell: bash - steps: - - uses: actions/checkout@v4 - - name: Run tests - run: cargo test --verbose - - run: make win-package - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') + app-id: ${{ secrets.RELEASE_APP_ID }} + private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + - uses: googleapis/release-please-action@v4 with: - draft: 'true' - make_latest: 'true' - generate_release_notes: 'true' - files: | - *win64.zip \ No newline at end of file + token: ${{ steps.app-token.outputs.token }} \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 099593c..1ed419c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,14 +6,15 @@ on: pull_request: branches: [ "master" ] +permissions: + contents: read + env: CARGO_TERM_COLOR: always jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Build diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..091cfb1 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.10.0" +} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..75b8e56 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/refs/heads/main/schemas/config.json", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "include-v-in-tag": true, + "include-component-in-tag": false, + "release-type": "rust", + "packages": { + ".": { } + } +} \ No newline at end of file